मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

Decanting problem. You are given three bottles of capacities 5,8 and 3 litres. The 8L bottle is filled with oil, while the other two are empty. Divide the oil in an 8L - Computer Science

Advertisements
Advertisements

प्रश्न

Decanting problem. You are given three bottles of capacities 5,8 and 3 litres. The 8L bottle is filled with oil, while the other two are empty. Divide the oil in an 8L bottle into two equal quantities. Represent the state of the process by appropriate variables. What are the initial and final states of the process? Model the decanting of oil from one bottle to another by assignment. Write a sequence of assignments to achieve the final state.

थोडक्यात उत्तर

उत्तर

To divide the oil equally in the oil bottle, the following 7 steps are needed:

  • Pour 5L of oil into the second bottle. (3,5,0)
  • Pour 3L from the second bottle to the third. (3,2,3)
  • Pour 3L from the third to the first. (6,2,0)
  • Pour all 2L from the second to the third bottle (6,0,2)
  • Pour 5L from the first to the second bottle. (1.5.2)
  • Pour 1 L from the second to the third bottle. (1.4.3)
  • Finally, pour now all 3L from the third bottle to the first (4,4,0)

Assignment statement as follows:

  • E,F,T = 8,0,0
  • E,F,T = 3,5,0
  • E,F,T = 3,2,3
  • E,F,T = 6,2,0
  • E,F,T = 6,0,2
  • E,F,T = 1,5,2
  • E,F,T = 1,4,3
  • E,F,T = 4,4,0
shaalaa.com
Composition
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Composition and Decomposition - Evaluation - Section - D [पृष्ठ १०१]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
पाठ 7 Composition and Decomposition
Evaluation - Section - D | Q 3. | पृष्ठ १०१
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×