TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A Counterintuitive Probability Game

60 点作者 EvanWard97超过 5 年前

15 条评论

dsukhin超过 5 年前
This is a super facinating observation. At first it does seem very counterintuitive but after a little examination, the resulting probabilities make a lot of sense.<p>For sake of easy math, pick C, your threshold, to be fixed at 0, which is halfway between -inf and inf.<p>Now there are 4 scenarios. The numbers player 1 chooses, A and B, can be both above or both below C with probability 1&#x2F;4 each. In both those cases, you have a 50&#x2F;50 chance of being correct on which number is larger depending on which number you chose to see.<p>Then, with the other 1&#x2F;2 of the times, one number will be above and the other will always be below C. In those cases, the selected strategy will have you always choose the correct highest number.<p>All together you are right 1&#x2F;2 + 2 * 1&#x2F;4 * 1&#x2F;2 = 3&#x2F;4 = 75% of the time. Simple probability but totally counterintuitive from the onset.<p>Now what if C!=0 or numbers are not being selected uniformly by your opponent? You can replace the 1&#x2F;2&#x27;s with (p) and (1-p) in the right spots without making any distributional assumptions and it seems (without doing the math out fully) that things cancel nicely and show that you always have a strictly greater than 1&#x2F;2 chance of guessing right no matter what. Exercise left for the reader :P
评论 #21160811 未加载
评论 #21143354 未加载
评论 #21145885 未加载
greenbay20超过 5 年前
Note that the paper claims that no matter how player A chooses the two numbers to write down, you can always guarantee &gt;50% chance in guessing which one is the higher one after only looking at one of the numbers. The reason this seems counter-intuitive is that the only information you&#x27;re given is one of the numbers. You are not told anything about how the first player picked her numbers. Now, the reason why OP&#x27;s code does not seem counter-intuitive to most is that it shows a quite different result. The OP assumed a specific distribution (which is a strong assumption, one the paper does not make) and found a strategy that yields &gt; 50%.
评论 #21160723 未加载
评论 #21154179 未加载
评论 #21161400 未加载
nabdab超过 5 年前
I’m really struggling to see how this is counter intuitive? You pick one of the numbers, and if it’s positive you say “this is likely the largest” and if negative “this is likely the smallest”. Since there’s a 50&#x2F;50 chance for each sign, and all positive numbers are larger than all negative numbers. That already gives you the minimum 1&#x2F;2 probability they are asking for. But you’ve got an improvement because not only does the other number have to match the sign for you to lose, it also has to be larger in magnitude, and that happens in half the cases where they have the same sign, so that gives you 1&#x2F;4 extra. You end up being correct 75% of the time. The thing with a random number in between is just an odd way of reducing your probability of winning by adding randomness to the split, what that’s supposed to show I’m really confused by.<p>It feels like the “puzzlement” you are supposed to feel that you can beat 50% comes from people ignoring the fact that you can look at the number before making your call.
评论 #21153668 未加载
评论 #21160689 未加载
评论 #21160650 未加载
gentaro超过 5 年前
I may be missing something here, but I&#x27;m not sure this is quite right.<p>The paper attached describes a scenario where the player A chooses a number between -infinite to infinite. The simulation uses ranges -1000000 to 1000000, it&#x27;s not a surprise that the strategy works in this case.<p>I think if the ranges were truly -infinite to infinite, this strategy would fall apart. No matter where you set C, there are infinite values above and below it.
评论 #21146997 未加载
评论 #21147629 未加载
评论 #21145019 未加载
评论 #21160829 未加载
laegooose超过 5 年前
Strictly speaking, the _probability_ that Player 2 did correct choice is not defined unless the random distribution used by Player 1 is defined.<p>Consider a paradox: Player 1 picks a random number X, writes it on a slip of paper, and 2X on another slip, and puts them randomly in front of Player 2 as &quot;left&quot; and &quot;right&quot;. Player 2 wins amount of money written on a slip he chose.<p>Let&#x27;s say he is about to pick left one (but didn&#x27;t see it yet). Let&#x27;s say left has number Y. The right one has either Y&#x2F;2 or 2Y, with 50&#x2F;50 probability. Which means right one is more profitable to pick, because it has 1.25Y on average!
评论 #21161107 未加载
bko超过 5 年前
From the paper, the only conditions of the first player (the person picking the initial two random numbers) is that they are distinct. They don&#x27;t have to be random and (as the implementation has) bound by the same range as the second player. If you use a different bound range for the two players, you get about 50&#x2F;50 odds.<p>The part I changed is scaling down the first players range by a factor of 100<p>a=random.randint(-R&#x2F;&#x2F;100,R&#x2F;&#x2F;100)<p>b=random.randint(-R&#x2F;&#x2F;100,R&#x2F;&#x2F;100)
markisus超过 5 年前
I think I drew a picture that could explain the effect. In the picture, player 2&#x27;s lower number is A, and their higher number is B.<p><a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;DKCtH81&#x2F;" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;DKCtH81&#x2F;</a><p>Red is the region where you lose, and Green is the region where you win.
评论 #21161096 未加载
lonelappde超过 5 年前
The &quot;solution&quot; relies on the fact that positive numbers arbitrarily close to 0 are still technically positive. If you assume that the range of numbers is finite, the solution is much more intuitive. If you assume that the range of numbers is actually infinite, and don&#x27;t use a misleading python program, a win ratio of &quot;0.5 + unknowably arbitrarily small episilon&quot; is the least impressive &quot;strictly greater than 0.5&quot; you can imagine.<p>You can&#x27;t win real money gambling in this game if you actually have infinite range of numbers.
评论 #21165674 未加载
zxcmx超过 5 年前
This still makes no sense to me. Picking a random number C adds no information, so I can&#x27;t see how it can influence the accuracy of your decision. Just from a naive information theoretic point of view.<p>If it&#x27;s possible to get some epsilon of advantage by choosing a C once, then... can you do it <i>more</i>? Can you combine or average more of them? Is 1 optimal? Why?<p>I fee like there&#x27;s some shenanigans here regarding assumptions about the distribution of A, B and C but I can&#x27;t really put my finger on it.
KwisatzHaderack超过 5 年前
Very interesting, thanks for sharing.<p>If C is chosen from the exact same distribution as A and B, I wonder if the strategy works even better than if C were any other random distribution. My intuition says yes.
评论 #21160491 未加载
kgwgk超过 5 年前
&gt; the benefit of using the entire Real number line as the possible range for C is to ensure that you at least sometimes<p>This may be a probability zero event unless you make some additional assumptions about how the numbers are selected. The whole real line is quite big and the probability of two finite intervals overlapping is null.<p>&gt; choose a value in between the ranges the other player is selecting numbers from
评论 #21162998 未加载
deckar01超过 5 年前
If you have ever played a card game where you have to guess if the next card is going to be higher or lower than another card, this should not be a surprising result. You should always assume the next card will be the average of all possible cards. What makes these kinds of games fun is having to recalculate the average card in you head based on the cards that you can see.
评论 #21163000 未加载
tomas789超过 5 年前
I’m struggling with choosing a random number t from (-inf, inf) where P(t) &gt; 0.
评论 #21144343 未加载
评论 #21160976 未加载
godelski超过 5 年前
From reading the comments, it seems the counter-intuitive part is that a bound like (-inf, inf) is different than a bound like [0,10].
Ragib_Zaman超过 5 年前
Great problem OP.<p>1 - As some people have already clarified for other commenters, it indeed makes no difference how Player 1 picks their numbers. They can pick them from some distribution of their own, or in an adversarial manner. The probability of winning by following the strategy in the paper is still strictly greater than 1&#x2F;2.<p>2 - In fact, even if Player 1 can read Player 2&#x27;s mind and knows their strategy and even the exact distribution they will sample from (but can&#x27;t see into the future to see the sample from the distribution), the probability is still strictly greater than 1&#x2F;2.<p>3 - Since it isn&#x27;t actually included in the paper or any of the comments, for the sake of completeness I&#x27;ll write down the computation.<p>Let P(E) denote the probability of an event E, and W be the event that Player 2 wins by following the strategy suggested in the paper. Let a, b be the smaller, larger number respectively. A is the event that Player 2 picked a, B is the event that Player 2 picked b. Then summing over disjoint events,<p>P(W) = P(A and W) + P(B and W) = P(W | A)P(A) + P(W | B)P(B)<p>We have P(A) = P(B) = 1&#x2F;2. Now let x be the result of Player 2 sampling from their distribution. Given that they picked A, they win if and only if a &lt;= x, so P(W | A) = P(a &lt;= x). Given that they picked B, they win if and only if x &lt; b, so P(W | B) = P(x &lt; b). Therefore,<p>P(W) = (1&#x2F;2) [P(a &lt;= x) + P(x &lt; b)] = (1&#x2F;2) [1 + P( x in [a,b) )]<p>4 - If I were to show this problem to someone else, I may try to emphasize the potentially adversarial nature of Player 1 and the odds seemingly being stacked against Player 2 by phrasing it like this (although this may be _over_ exaggerated):<p><i></i>* Player 1 gets to write down any two distinct real numbers on two pieces of paper, and then flips a coin. Player 2 gets to see the number on the left if the coin lands on Heads, the number on the right if the coin lands on Tails. After seeing the number, Player 2 must declare whether they are seeing the smaller or larger number. If Player 2 guesses correctly, they win $1 from Player 1. Otherwise, Player 2 pays $1 to Player 1.<p>Further, now knowing the rules of the game, both players can choose any particular strategy of playing the game. However, whatever Player 2 chooses as their strategy, they must inform Player 1 of their strategy and not deviate from it when the game is played. Player 1 is allowed to adjust their strategy after hearing Player 2s strategy. Would you prefer to be Player 1 or Player 2? <i></i>*<p>I think worded like that, many peoples first guess might even be Player 1. Then their next answer would be that it doesn&#x27;t matter, and then they&#x27;re in for a treat when they see that they should choose to be Player 2!
评论 #21166236 未加载
评论 #21167081 未加载