Once upon a time, there is a special 7up store in GUB. If you return three empty [CO3] bottles to the shop, you'll get a full bottle of 7up to drink. If you have N empty bottles right in your hand, how many full bottles of 7up can you drink? Let me tell you how to drink 5 full bottles with 10 empty bottles: get 3 full bottles with 9 empty bottles, drink them to get 3 empty bottles, and again get a full bottle from them. Now you have 2 empty bottles. Borrow another empty bottle from the shop, then get another full bottle. Drink it, and finally return this empty bottle to the shop!

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter17: Markov Chains
Section: Chapter Questions
Problem 12RP
icon
Related questions
Question

[The [CO#] represents mapping of the question with one of the expected outcomes of the course.]
Note: programing will have to done with c++ and most certainly it should be in easy method 

Once upon a time, there is a special 7up store in GUB. If you return three empty [CO3]
bottles to the shop, you'll get a full bottle of 7up to drink. If you have N empty bottles
right in your hand, how many full bottles of 7up can you drink?
Let me tell you how to drink 5 full bottles with 10 empty bottles: get 3 full bottles with
9 empty bottles, drink them to get 3 empty bottles, and again get a full bottle from
them. Now you have 2 empty bottles. Borrow another empty bottle from the shop, then
get another full bottle. Drink it, and finally return this empty bottle to the shop!
Transcribed Image Text:Once upon a time, there is a special 7up store in GUB. If you return three empty [CO3] bottles to the shop, you'll get a full bottle of 7up to drink. If you have N empty bottles right in your hand, how many full bottles of 7up can you drink? Let me tell you how to drink 5 full bottles with 10 empty bottles: get 3 full bottles with 9 empty bottles, drink them to get 3 empty bottles, and again get a full bottle from them. Now you have 2 empty bottles. Borrow another empty bottle from the shop, then get another full bottle. Drink it, and finally return this empty bottle to the shop!
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole