Fascinating.. I just took an Operating Systems midterm today with that EXACT same problem on. Same burst times for each process and everything. Where did you get this problem from??
As for your question, I think that you need do this:
Everytime a process is not running, it is waiting. So you need to calculate the wait time for each process individually. It'll look something like this
Code:
00-01-02-03-04-05-06-07-08-09-10-11-12-13-14-15-16-17-18
P1-P2-P3-P4-P5-P1-P3-P5-P1-P5-P1-P5-P1-P5-P1-P1-P1-P1-P1
So for each process you need to add all the slices where its not running, this will be the total wait time for each process. For the end slices, where only P1 is running, it will not be waiting. Then sum each process' wait time and divide by 5.