Computer Science, asked by naeemabbas62615, 4 months ago

a. Ms. Shell has 2 opaque drums of capacity 8-liters and 5-liters, a resource of Oil, and a bit of brain. She uses these two drums to measure 1-liter, 2-liters, 3-liters, 4-liters, 6-liters and 7-liters to any customer. How can she do that? What steps shall she take for each order? Note that there is no marking of liters possible on the drums. b. Now you have to measure again the same quantities but you have 9-liters and 6-liters opaque drums. Can you solve that same problem, if yes, how? If no, explain why?

Answers

Answered by Anonymous
0

Answer:

Explanation:

(a)  

1. fill the oil in 5 liters drum and pour it into 8 liters drum.

2. now fill 5 liters drum again and pour it into 8 liters now remaining oil in 5 liters drum is 2 liters ( 2 liters is checked )

3. now drain 8 liters drum and pour 2 liters remaining from 5 liters drum  

4. fill 5 liters drum again and pour it into 8 liters drum that has already 2 liters on it so it means 7 liters is checked.

5. drain 5 liters drum and refill it and pour it into 8 liters until it is full

6. 8 liters drum has 7 liters oil in it so drum is full after accepting 1 liter oil and we have 4 liters remaining in drum ( it means 4 liters is also checked ) .

7. empty both drums  fill 8 liters drum and pour it into 5 liters drum so remaining oil in 8 liter drum is 3 liters ( 3 liters checked as well)  

8.drain 5 liters and pour 3 liters oil from 8 liters drum  

9. now fill 8 liters drum and pour it in it 5 liters drum which is having already 3 liters in it . after filling 5 liters drum from 8 liters we get 6 liters oil.

(b)

. we get same sequence of number like 6 and 9 so may be it be difficult .

Similar questions