A problem from /sci/
I wrote some code that runs through and tries out different cutoffs, keeping the winner each time and giving the loser a new random cutoff (between 0.5 and 0.7 - this seems to be a good range).
Anyways, the answer comes out to around 60% consistently.
How to prove mathematically?
>>59094725
the code
>>59094725
bump?
does it involve integrals. do you nerds know about integrals?
>>59094725
So you've written a program to try and solve the problem in the OP image. I dont mean to be an ass but i dont understand how this is /g/ related. Does the program not work?
>>59094791
The fact that it specifies an uniform distribution should tell you this is a probabilities problem.
>>59094725
What you do is, you calculate what is the average number that comes up, and anything above that number is stupid to cutoff, that is all.
call me retarded but isn't this a regression problem?
>>59094725
there is no optimal cutoff
python's RNG is garbage, use an external source like entropypool
bump, I got it, don't want to 404 while I'm typing
>>590947251 - e^(-1)
>>59096588
We are looking for x. If you get a number below x, you go on, if you get one above it, you keep it. The optimal strategy is if you have a 50% chance of getting at least x on two tries.
Chance of getting a number above x on the first try: 1-x
Chance of getting a number below x on the first try: x
Now, if you get a number below x, you keep playing:
Chance of getting a number above x on the second try: 1-x
So, you have an 1-x chance of getting a number above x on the first try, and you have an x*(1-x) chance of getting a number above x on the second (you have to fail the first). so
1-x + x*(1-x) = 0.5
(x+1)*(1-x)=0.5
x1=0.7070707...
x2=-0.7070707...
so x1 is the solution, meaning the cutoff is 0.7070707, or 1/sqrt(2)
>>59096692
Sorry, goofed up the decimal. The solution is still 1/sqrt(2), however that is not 0.7070707..., but 0.70710678118something
That sounds like a really awful game show.
>>59096692
>>59096720
Tested it with a program, you are indeed 50% likely to get a number above 1/sqrt(2) with this strategy (left value is when the number was bigger, right value is when the number was smaller).
>>59096809
At least you're not going home with a stinky goat :^).