Gumball Logic Math puzzle

175 Views Asked by At

Gumball Machine Diagram

You walk into an antique shop and find an unusual gumball machine. On the back of the gumball machine you can set and lock five dials with the following labels:

  • Percentage (0% through 100%)
  • Pink (0 through 10)
  • Pink+Green (0 through 10 for pink and 0 through 10 for green individually)
  • Green (0 through 10)

A note below the dials reads "Fill machine with any number of pink and green gumballs. 400 gumballs maximum capacity."

On the front of the gumball machine is a slot to place a penny and a dial to turn and receive your treat.

You buy the machine and 1000 gumballs (500 green, 500 pink) and take it home. After a few days of experimenting you've learned the following:

  • When the available number of pink gumballs is greater than the Percentage of the original (starting) number of pink gumballs it will release gumballs depending on the Pink+Green settings
  • When the available number of pink is less than or equal to the Percentage of the original (starting) number of pink gumballs it will stop releasing pink gumballs and release green gumballs as set by the Green dial
  • When all green gumballs are dispensed it will then release pink gumballs as designated by the Pink dial
  • If a remainder of gumballs is left it will dispense the remainder on the next turn
  • At least one gumball of either color must be released for each penny until the machine is empty. This means if P=0 then G>=1 else if G=0 then P>=1.

As an example:

  • Fill the gumball machine with 140 pink and 100 green
  • Set the Percentage dial to 70%
  • Set the Pink+Green dial to 1-pink and 1-green
  • Set the Pink dial to 1-pink
  • Set the green dial to 2-green

Using the example settings the machine will release:

  • 1-pink and 1-green gumball per turn until the number of pink is less than or equal to 70% of the original (starting) number of pink gumballs
  • At less than or equal to 70% of the original (starting) pink gumballs it will release 2-green gumballs 0-pink gumballs until all green gumballs are gone
  • When empty of green gumballs it will release 1-pink gumball per turn until the entire machine is empty

Clarification about remainders: If there is any remainder of a setting, such as 6 Pink when set to 7 Pink, it will dispense the 6 remaining Pink gumballs. Likewise if we are in the P+G phase and there is a remainder of Pink to reach the <=% it will dispense the remainder of Pink to reach the % or lower.


CAN YOU ANSWER THE FOLLOWING FOUR QUESTIONS?

  1. How much money will it cost to get all the gumballs in the example?

  2. How do you calculate for all possible settings?

  3. If two green gumballs equals the cost of one pink gumball what are the best dial settings to get the most money?

  4. If two green gumballs equals the cost of one pink gumball what are the worst dial settings to get the least money?

1

There are 1 best solutions below

0
On

The first part of your question could be solved by calculating as follows:

The first 42 pennies you put into the machine, it will release 1 pink gumball and one green gumball. After this, there will be 98 pink and 58 green still in the machine. Then after $\dfrac{58}2=29$ more pennies, the greens will all be gone. There is then only the pinks, and after another 98 pennies, the machine is empty. The total is therefore $\$.42+\$.29+\$.98=\$1.69$ for the entire machine.