Imagine that you and two friends are washing the dishes by hand after dinner. The order of operations required to wash a single dish are as follows: Rinse (15 seconds) Scrub with Soap (30 seconds) Rinse (15 seconds) Dry (15 seconds) One friend is assigned to Rinse, another is assigned to Scrub, and you are assigned to Dry. Initially, you do not pipeline your work. However, you suddenly notice that Game of Thrones is about to air on TV, so you decide to pipeline your work so that you can finish washing the dishes as quickly as possible. How many seconds will it take to wash 18 dishes using a pipelined approach

Respuesta :

Answer:

it will take 1095 seconds to wash 18 dishes using a pipelined approach

Step-by-step explanation:

Let represent the identity of those three people with :

A

B

C

Now; let the function assigned to those  the people be:

A = Rinse

B =Scrub with soap

C = Dry

For the first dish pipeline

A(RInse) = 15 seconds

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

The total time taken to complete one dish to wash = (15 +30+  15+15)seconds = 75 seconds

However ; A cannot take the second dish for rinse until the first dish has not been rinse for the second time by A,   A can only start rinse from the second dish when the first dish is at C for dry

SO; for the second dish:

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

Similiarly ; for the third dish

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

B (Scrub with soap) = 30 seconds

A(RInse) = 15 seconds

C(Dry) = 15 seconds

Therefore, the total time taken to was 18 dishes = time to wash the first dish + time remaining for 17 dishes

= 75 +(30+15+15)×17

= 1095 seconds

Hence, it will take 1095 seconds to wash 18 dishes using a pipelined approach

Q&A Education