Bob's game

Bob is playing a game. He places a token on a number line at 0. Then, he flips a coin. If heads, he moves his token 4 spaces to the right. If tails, he moves his token 9 spaces to the right. What is the greatest positive integer that cannot be landed on with that game?


The answer is 23.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

13 solutions

Pi Han Goh
Dec 24, 2013

This is a simple case of Chicken McNugget Theorem .

In this case, m = 4 , n = 9 m n m n = 23 m = 4, n = 9 \Rightarrow mn-m-n = \boxed{23}

Thank you for the reference! This little theorem definitely predates the Chicken McNuggets (though not the chicken). Cool name though :) A classical setup for this problem is coins of two different denominations.

Alexander Borisov - 7 years, 5 months ago

Log in to reply

How do we do this if there are more than 2 variables

Example here it is of the form 4X+9Y

What if it is 5X+7Y+19Z (or more than three.........)

Sanjay Banerji - 7 years, 5 months ago

Log in to reply

I think in that case the situation is considerably more complicated, especially if some of the coefficients have common factors (like 5 x + 14 y + 18 z . 5x+14y+18z. ) It is still true, of course, that all large enough numbers can be represented, as long as the G.C.D. of all coefficients is 1. 1. But I do not know of a simple formula for the largest non-representable number, even in the three-variable case. If anybody knows such formula (or a good algorithm), please post.

Alexander Borisov - 7 years, 5 months ago

Log in to reply

Log in to reply

@Pi Han Goh Excelllent references, thank you!

Alexander Borisov - 7 years, 5 months ago

Log in to reply

@Alexander Borisov This number is actually called Frobenius number. Frobenius number from Wolfram|Alpha

Samuraiwarm Tsunayoshi - 7 years, 5 months ago

Thank you for the reference

Vaibhav Agarwal - 7 years, 3 months ago

This number (greatest positive integer that can't be written in form of a k + b m ak + bm where g c d o f g i v e n n u m b e r ( g c d ( a , b ) = 1 gcd of given number (gcd(a,b)=1 and a , b , k , m a,b,k,m are positive integers.) is called Frobenius number.

Here's the formula for this number. F r o b e n i u s ( a , b ) = a b ( a + b ) Frobenius(a,b) = ab - (a + b) .

Apply to this formula we get 4 × 9 ( 4 + 9 ) = 23 4 \times 9 - (4 + 9) = \boxed{23} .

PS: There's no formula for finding Frobenius of more than 2 numbers.

Edward Jiang
Dec 26, 2013

This is trivial by the McNugget Theorem.

Adit Mohan
Dec 26, 2013

the numbers that can be landed are of the form : 9a+4b.
=4(2a)+a+4b.
=4{2a+b}+a.
now let a =0,1,2,3.
all numbers can be written as 4n+0,1,2,3.
now if the answer is of the form 4n+0, then a=0 and all such values can be formed by taking different values of b if the answer is of the form 4n+1, then a=1 and hence all such values greater than 4(2.1)+1=9 can be formed.
if the answer is of the form 4n+2, then a=2 and hence all such values greater than 4(2.2)+2=18 can be formed.
if the answer is of the form 4n+3, then a=3 and hence all such values greater than 4(2.3)+3=23 can be formed.
the answer is 23





Aditya Joshi
Feb 21, 2014

I don't have a smart solution for this, but here goes.

I just listed a few terms that could be formed by either adding 3 3 or 9 9 to the previous terms. I got a series of the form { 4 , 8 , 9 , 12 , 13 , 16 , 17 , 18 , 20 , 21 , 22 , 24 , 25 , 26 , 27 , 28 , 29 , } \{ 4,8,9,12,13,16,17,18,20,21,22,24,25,26,27,28,29, \dots \} . I postulated that any number > 29 > 29 can be obtained using 4 4 and/or 9 9 . This obviously isn't rigorous, but this is how I solved it.

Pebrudal Zanu
Dec 29, 2013

The line number 28+4t,29+4t,30+4t,31+4t can be landed on with that game. So, Suppose greatest positive integer cannot be landed of the token is N. Simple check for N=23 cannot be landed of that game.

This is formed by 4 and 9 to right step.

28=7 \times 4,

29=5 \times 4+9,

30=2 \times 9+3 \times 4,

31=3 \times 9+4,

Assumse we get heads token for next step.

pebrudal zanu - 7 years, 5 months ago
Siddharth Kumar
Dec 27, 2013

We know that gcd(9,4)=1, hence they are co prime. So the above problem can be represented in the form:- 4x+9y=z, where x and y are positive integers, so what can be the maximum non-valid value of z. Using the chicken mcNugget Theorem (cool name, isn't it!!), which says that for two co prime positive integers a and b, the largest number which cannot be written in the form ax+by (where x and y are positive integers) is ab-a-b. By this theorem the largest non valid value for z is (9)(4) - 9 - 4 = 23. Hence the desired result. Q.E.D.

Sanjay Banerji
Dec 26, 2013

After understanding that we need to find the greatest number which cannot be written in the form 4X+9Y I used the following java program ::

import java.io.*;

public class BobGame

{

public static void main(String args[])

{

    int i=0;

    BobGame obj=new BobGame();

    for(i=1000;i>0;i--)

    {

        if(obj.fun(i,0)==0)

            break;

    }

    System.out.println(i);

}

int fun(int n,int p)

{

    int h=0;

    h=9*p;

    h=n-h;

    if(h<0)

        return 0;

    else if(h%4==0)

        return 1;

    else return fun(n,p+1);

}

}

Ivan Koswara
Dec 25, 2013

Rant : Why is there a problem that can be solved using a simple application of a theorem named after a product of a fast food chain ?

Complete proof : Use the coin theorem (linked above) to see that the answer is ( 4 1 ) ( 9 1 ) 1 = 23 (4-1)(9-1) - 1 = \boxed{23} .

Kaan Dokmeci
Dec 25, 2013

Chicken McNugget: 4*9-4-9=23

Trevor B.
Dec 25, 2013

According to the Chicken McNuggets Theorem, the largest positive integer n n that has no non-negative integer solutions for x x and y y where a a and b b are positive integer constants to the Diophantine equation a x + b y = n ax+by=n is a b a b . ab-a-b\text{.}

In this problem, we are looking for the largest n n for which there is no non-negative integer solutions for x x and y y to the equation 4 x + 9 y = n . 4x+9y=n\text{.} Here, x x represents the number of heads and y y represents the number of tails. The largest n n is found by applying the CMT where { a , b } = { 4 , 9 } . \{a,b\}=\{4,9\}\text{.} 4 × 9 4 9 = 23 . 4\times9-4-9=\boxed{23}\text{.}

Hahn Lheem
Dec 25, 2013

It is possible to directly apply the Chicken McNugget Theorem to this problem. The greatest possible positive integer that cannot be expressed as the sum of a specific amount of m m 's and a specific amount of n n 's can be expressed as m n m n mn-m-n , or simply stated, the product minus the sum. Substituting the values 4 4 and 9 9 , we get 36 13 = 23 36-13=\boxed{23} .

Anne Hao
Dec 24, 2013

For this problem, you compute (9x4)-(9+4) which is 36-13, which is 23

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...