We read your photo as:

Calculate the waiting times and average waiting time for processes P1, P2, P3 with burst times 4, 13, 12 using FCFS.

Computer Science

ScanSolve AI Answer

Answer

7\text{7}

Step-by-step solution

4 steps

Here's the calculation for the waiting times and average waiting time using the First Come First Served (FCFS) scheduling algorithm, based on the provided burst times.

Given Burst Times:

  • P1: 4
  • P2: 13
  • P3: 12

The waiting time for a process ii is calculated as the sum of the burst times of all processes that completed before it. The formula from your notes, WTi=(∑j=1iBTj)−BTiWT_i = (\sum_{j=1}^{i} BT_j) - BT_i, correctly represents this.

  1. Calculate the waiting time for P1.

    P1 is the first process, so it starts immediately.

    WT1=0WT_1 = 0

    Using the formula:

    WT1=(BT1)−BT1=4−4=0WT_1 = (BT_1) - BT_1 = 4 - 4 = 0
  2. Calculate the waiting time for P2.

    P2 waits for P1 to complete.

    WT2=BT1WT_2 = BT_1

    Using the formula:

    WT2=(BT1+BT2)−BT2WT_2 = (BT_1 + BT_2) - BT_2 WT2=(4+13)−13WT_2 = (4 + 13) - 13 WT2=17−13WT_2 = 17 - 13 WT2=4WT_2 = 4

    Your calculation for P2 incorrectly subtracted 4 instead of 13.

  3. Calculate the waiting time for P3.

    P3 waits for P1 and P2 to complete.

    WT3=BT1+BT2WT_3 = BT_1 + BT_2

    Using the formula:

    WT3=(BT1+BT2+BT3)−BT3WT_3 = (BT_1 + BT_2 + BT_3) - BT_3 WT3=(4+13+12)−12WT_3 = (4 + 13 + 12) - 12 WT3=29−12WT_3 = 29 - 12 WT3=17WT_3 = 17
  4. Calculate the average waiting time.

    The average waiting time is the sum of all waiting times divided by the number of processes.

    Average Waiting Time=WT1+WT2+WT33\text{Average Waiting Time} = \frac{WT_1 + WT_2 + WT_3}{3} Average Waiting Time=0+4+173\text{Average Waiting Time} = \frac{0 + 4 + 17}{3} Average Waiting Time=213\text{Average Waiting Time} = \frac{21}{3} Average Waiting Time=7\text{Average Waiting Time} = \boxed{\text{7}}
Was this helpful?

Try one yourself

A new problem that tests the same skill.

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question
Handwritten step-by-step solution preview

Handwritten Step-by-Step Solution

Get this as a handwritten image on WhatsApp — like a tutor wrote it for you.

Try on WhatsApp