pick an integer from 0 to 100 ... can i guess it in 7 tries?
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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?
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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 :)
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
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