Sunday, June 17, 2018

logical deduction - Do better than chance


You and an opponent are playing the following game:



  1. Your opponent picks two different real numbers, however he wants to, and writes them on two cards, which he presents to you face down

  2. You choose one of the cards, and look at its value

  3. You say "the card I picked is higher" or "the card I picked is lower"

  4. Your opponent reveals his card, and if you were correct, you score a point. Otherwise, your opponent scores a point.



Your aim is to pick a strategy for this game such that your probability of winning each point is greater than 50%. To make it more difficult, there is an extra rule:



  1. You must tell your opponent your strategy before he picks his numbers, and stick to that strategy. He keeps his owns strategy secret.


Note


Your opponent is completely unlimited as to which numbers he picks, he can pick any real numbers, with any strategy he wants. Obviously this is a bit unrealistic, because some strategies would in reality be impossible to actually compute (e.g. if your opponent wanted to randomly pick two numbers from a flat probability distribution over all real numbers).


So to be clear, both you and your opponent have the magic ability to do arbitrarily precise mathematics in a short length of time, and are able to mentally generate random numbers from a probability distribution in a way that's not constrained by whether a real computer could do the same thing.


Rule clarifications


The main rule is: No cheating or loopholes. This is a mathematical logic puzzle, not an attempt to find a way around the rules. I'll try to close some of the more obvious ones here, but if any more come up that I haven't thought of, I'll add them here too.




  • Any number can fit on a card, even if in reality it would take an infinite amount of space.

  • Likewise, any number can be written onto or read from a card in a reasonable length of time, unrelated to how large that number is or how many digits it has.

  • The "magical" power for mental maths you and your opponent have is just about being able to do calculations or generate numbers from probability distributions that wouldn't normally be possible either because of arbitrarily precise numbers or arbitrarily large numbers. You're not psychic, or anything similar. So, for example, your opponent can't have the strategy "I'm going to write 5 on this card if my opponent is thinking about a cat, otherwise I'm going to write 6.2"



Answer



Step 1.



Decide on a function $M(x)$ that will map real number $x$ to the range $(0,1)$ such that if $y > x \implies M(y) > M(x)$. One possibility is $M(x) = 0.5+{1 \over \pi}\ tan^{-1}(x)$. But there are many other options. This effectively maps your opponents two real numbers onto a point in the $[0..1,0..1]$ square.




Step 2.



Randomly choose a card, read the number and apply your $M(x)$ function to generate a number $p$.



Step 3.



Generate a uniform random number $u$ in the range $[0,1]$ and if $p > u$ state "the card I picked is higher" (if $p < u$ make the opposite statement).



This works as follows:




Your opponent has chosen (by whatever means) two distinct numbers $x$ and $y$. The numbers are unknown but it is fine to arbitrarily label the smaller of their chosen numbers as $x$ and the larger as $y$ i.e. $x < y$. If you applied your mapping function to them then you generate numbers $p$ and $q$ such that $p < q$. You choose the card at random so you have a $0.5$ probability of picking each of $x$ and $y$.




If you chose the card with $x$ written on it (the lower of the two numbers) then you correctly claim the other card as the higher (and win) with probability $(1-p)$, and incorrectly claim $x$ as larger (and lose with probability $p$). So expected yield is $(1-p) - p = 1-2p$. Alternately if you chose the card with y written on it you guess incorrectly with probability $(1-q)$ and correctly q, with expected yield $2q-1$. Combining these (and dividing by two, as initial choice of each card occurs 50% of the time), your expected score per round is $0.5 \times (1-2p +2q-1) = q-p$. But $q > p$ because $M(y) > M(x)$ because $y > x$, thus your expected score is strictly greater than zero (i.e. positive).




This will work for any function M that monotonically maps reals into the interval $[0..1]$. Depending on your M function your opponent can choose their number pair in such a way as to make your expected profit arbitrarily small, but it will always be strictly positive.



No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...