Ask your own question, for FREE!
Mathematics 14 Online
OpenStudy (amistre64):

pick an integer from 0 to 100 ... can i guess it in 7 tries?

Parth (parthkohli):

OK, let's go.

OpenStudy (amistre64):

rules, of too low, say higher if too high, say lower

OpenStudy (amistre64):

is it 50?

Parth (parthkohli):

go higher

OpenStudy (amistre64):

50+25 ... is it 75?

Parth (parthkohli):

isn't this some algorithm?

Parth (parthkohli):

go lower

OpenStudy (ipwnbunnies):

It's witchcraft.

OpenStudy (amistre64):

50+25-12, is it 63

Parth (parthkohli):

go higher

OpenStudy (amistre64):

50+25-12+6, is it 69?

Parth (parthkohli):

go lower

OpenStudy (amistre64):

50 + 25 - 12 + 6 - 3, is it 66

Parth (parthkohli):

go higher

OpenStudy (amistre64):

so, its either 67 or 68 and i have 2 guess left :)

Parth (parthkohli):

bazinga. 68.

OpenStudy (amistre64):

2^7 = 128 so you are bound to limit in on the interval

OpenStudy (fibonaccichick666):

I was just typing that... haha

Parth (parthkohli):

Oh!

OpenStudy (fibonaccichick666):

Cool trick for shrinking a domain

OpenStudy (amistre64):

yep, i programmed a rabbit to follow a predefined curve with it :) well, a binary rabbit

OpenStudy (amistre64):

i used 1/2^100 chances to get within an acceptable error to move along the curve

Parth (parthkohli):

so you can do this with any number b/w 1 to 128 in theory?

OpenStudy (amistre64):

[0,128] [0, 64] [0, 32] [0,16] [0,8] [0,4] [0,2] .. 0,1,2 is not a good bet for picking 1 of 3

OpenStudy (amistre64):

i spose we start with 0,128 bing a 0 guess lol

OpenStudy (amistre64):

[0,128] [0, 64] [0, 32] [0,16] [0,8] [0,4] [0,2] [0,1] .. looks good to me

Parth (parthkohli):

highest interval for 7 guesses, I meant.

OpenStudy (amistre64):

by some version of the nested interval thrm, you can reduce the range of options

OpenStudy (amistre64):

well for a safe bet, 128 seems to be the largest

OpenStudy (amistre64):

0,130 0,65,130 0,32,65,97,130 0,16,32,48,65,81,97,113,130 0,8,16,24,32,40,48,56,65,73,81,89,97,105,113,121,130 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,65,69,73, 77,81,85,89,93,97,100,105,109,113,117,121,125,130 largest interval is 5 and 2 guess left

OpenStudy (amistre64):

largest interval if not guessed is between 0 and 5: 1234 elements g 3 or 4 for a final guess is not a sure thing

OpenStudy (fibonaccichick666):

it seems to me in order to generalize it, it'd have to be \(x<2^{n+1}\) where n is the number of guesses

OpenStudy (amistre64):

seems like a fair generalization

OpenStudy (amistre64):

\[x\le2^n\]

OpenStudy (fibonaccichick666):

Sorry, 2^n with n+1 being the number of guesses

OpenStudy (amistre64):

2^7 = 128, and in 7 guess we can get to x 130 < 2^8 and we would need 8 guess to be sure

OpenStudy (amistre64):

10 < 2^4 .... 4 guess 0,5,10 0,2,5,7,10 1 34 6 89 in 2 guesses

OpenStudy (fibonaccichick666):

with 128 it took 8 guesses I thought

OpenStudy (amistre64):

nah, the initial state is not a guess, it was just stating the interval

OpenStudy (fibonaccichick666):

whoops

OpenStudy (fibonaccichick666):

I see now

OpenStudy (amistre64):

guess 0 was [0,n] :) which aint a guess its just initializing the setup

OpenStudy (fibonaccichick666):

true, but I count it as a guess

OpenStudy (amistre64):

first guess, is it 128? lol

OpenStudy (amistre64):

id accept that

OpenStudy (fibonaccichick666):

so then we get this relation \(2^{n-1}<x\le 2^n\)

OpenStudy (amistre64):

lets assume the solution is 128 64 32 16 8 4 2 1 yeah, we would need 1 more guess for 0 or 128

OpenStudy (amistre64):

but more often than not, people will not choose an endpoint :)

OpenStudy (fibonaccichick666):

true

OpenStudy (fibonaccichick666):

but x is the number of options not the number

OpenStudy (fibonaccichick666):

0-128 has 129 options

OpenStudy (amistre64):

im ready for a thrm :) if \(k\le2^n,~k\not\in Z^-,\) then the number of guess needed is \(\small n+1\)

OpenStudy (fibonaccichick666):

I think you need to define k

OpenStudy (amistre64):

or possibly k in Z+ or 0

OpenStudy (fibonaccichick666):

and at maximum n+1

OpenStudy (amistre64):

maximum yes, or safest number of guesses

OpenStudy (amistre64):

the least upper bound lol

OpenStudy (fibonaccichick666):

true lol So what did we develop this grand theory for?

OpenStudy (fibonaccichick666):

annd also, if you publish this, I want my name on it! haha

OpenStudy (amistre64):

posterity?

OpenStudy (amistre64):

is that 1 c or 2?

OpenStudy (fibonaccichick666):

haha, and I'll let you cite my real name if you do, but it's 2 ;P

OpenStudy (amistre64):

oh im sure someone else many hundreds of years ago ironed this out and got shot afterwards :) right Cardano?

OpenStudy (fibonaccichick666):

3 total

OpenStudy (fibonaccichick666):

lmao

OpenStudy (amistre64):

one of them was a gambler ... prolly not Cardano, or was it?

OpenStudy (fibonaccichick666):

idk, but gtg class I'll check back later

OpenStudy (amistre64):

have fun ;)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!