[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

A problem from /sci/ I wrote some code that runs through and

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 3

File: mathz.png (482KB, 883x905px) Image search: [Google]
mathz.png
482KB, 883x905px
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
>>
>>59094725
1 - 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.
>>
File: file.png (5KB, 309x43px) Image search: [Google]
file.png
5KB, 309x43px
>>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 :^).
Thread posts: 16
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.