>>
|
No. 2884
[Edit]
[Cont] from >>2874
So I mentioned that martingales reminded me of something else, and indeed I remember I once took a course on combinatorics that touched upon notions of randomness, and used computable martingales as a way to measure this. Basically, let's reframe the problem in the abstract: we're given an infinite sequence of coin flips and want to distinguish if this is "random" or not. If we had some sort of magical function that did this for us, the problem is trivial, and we don't even need to worry about the cheater's possible strategies.
Does there exist such a function "f"? It turns out we can indeed show the existence of such a function by borrowing ideas from betting theory, namely martingales. Very roughly, a martingale is a betting strategy: a function that takes as input a string of past events, and returns probabilities for the bets that should be placed on the next event that will occur (in the extremes where you wager 100%, if you get it right you double your money, if you get it wrong you lose all your money). Moreover the martingale here needs to be computable, i.e. be a finite/bounded algorithm (so it can't just encode the entire infinite string).
Clearly, no betting strategy can make money on truly random coin flips, whereas a non-random sequence provides an opportunity to make money. In fact, we can define a given sequence as non-random if there exists a computable martingale that wins an unbounded amount of money.
Some interesting examples:
* Sequence that is digits of pi – not random by this definition, since we can compute digits of pi in a finite algorithm and win money
* Sequence whose odd digits are pi, even digits are coin flips – also not random, since we can make the trivial bit (50-50) odds on even digits and rake in money on odd digits, so our winnings can be unbounded.
* Sequence that is always a fixed prefix followed by random digits – This _is_ random by the computable martingale definition, since our winnings are bounded. (Intuitively, this goes back to how we can't use fixed prefixes to assign blame, since someone might have gotten unlucky).
Now we will show that there exists a computable martingale that succeeds on any random walk that never crosses the origin (i.e. we can predict the next bit with non-trivial probability in an online manner). This is because out of all length-n random walks, those that are strictly-positive-valued are a small fraction (challenge: find a formula for the number of length-n strictly positive random walks), and as n->infty, the fraction of such strings -> 0.
This means that we have a sequence {a_1, a_2, ...} whose finite prefixes {{a_1}, {a_1, a_2}, ...} become "increasingly rare" according to some property [strictly positiveness] (and importantly is not something that would happen in a genuine random walk). This is a property we can exploit in our betting strategy, by conditioning our bets on this property being true (more on this later).
Now given any martingale, we also have the property that we can split it into two martingales. One martingale will make the same moves as the original on odd number moves, and bet trivially (50/50) on even moves. The other will make the same moves as the original on even moves, and bet trivially (50/50) on odd moves. If the original martingale succeeded on a sequence (won an unbounded amount of money), then at least one of the split martingales must also succeed on that sequence.
The person whose split martingale succeeds in winning unbounded amounts is the cheater.
This non-constructively shows that it's possible to identify the cheater, but I think if you just formalize the algorithm for the martingale described then it's also constructive, and you formalize it in the natural way.
As an example, among sequences of length 3, exactly 1/2 are strictly positive. So I claim we can double our money in these first 3 digits. The way we do this is by conditioning our bets only on the sequences that are strictly positive. I.e. if currently the martingale has as input the prefix of length 2 (call this length-2 prefix w), and we're betting on the outcome of step 3. Let k_1 be the fraction (amongst all strictly positive length-3 strings) that have w0 as a prefix, let k_2 = 1 - k_1 be the fraction of strictly-positive length-3 strings that have w1 as a prefix; bet on the next bit according to those fractions.
The reason why this works is as follows: we'll show that given "insider information" that all outcomes are guaranteed to have some property that holds in a fraction 1/x of the sample space, we can bet to multiply winnings by x.
Let's say among the n-bit strings K strictly-positive strings start with 0 and L strictly positive-strings start with 1. Then the fraction is (K+L)/2^n. We'll show that our overall winnings multiplier will be 2^n/(k+l). When we bet, we bet with probability k/(k+l) on 0 and l/(k+l) on 1. WLOG if it was indeed a 0, our winnings are multiplied by 2k/(k+l). Then the process repeats – we now have only k such n-1 bit strings beginning with 0, but we know that by inductive hypothesis, our multiplier is 2^(n-1)/k. So the net is indeed 2^n/(k+l).
Intuitively, the more rare the property the bigger advantage we have over the house since because a rare long prefix will almost certaintly fix the rest of the sequence. (Challenge: can you write a quick program to demonstrate/visualize this?)
This property can then be repeatedly exploited over longer and longer prefixes:
So the overall algorithm would be like:
We start with 1 unit of money.
* Divide this unit as 1/2, 1/4, 1/8, 1/16, etc.
* Each of these will be given as initial capital to a series of gamblers who operate in parallel: The goal of the first gambler will be to 4x the input money, the goal of the second is to 16x, the input, the goal of the third is to 64x the input, and so on.
* Each gambler does so by choosing an apporiately long (and hence appropriately rare) prefix length, then using the above strategy. Note that the computation of the needed prefix length does not depend on the specific string we are given, it can be precomputed.
* The overall winnings hence clearly are unbounded (2 + 4 + 8 + ...)
Note that prefixes are overlapping, so the process described above is happening "in parallel" not sequentially – which is not actually a true martingale which must be sequential. But I think this is not a major issue since we can combine them into a single martingale. E.g. When betting on the first state the new combined martingale will simulate all other machines, and then make a combined bet appropriately. Or maybe we don't even need to simulate and can just naively start the second after the first finishes – the second gambler _would_ have used a different probability when betting on the common prefix that gambler 1 had already bet on, but I think since the sequences get longer and longer anyway the probabilities won't differ by that much so things could still work, I need to think more about this.
In short, we have shown that because strictly-positive random walks are a negligible fraction (-> 0) of genuine random walks, there exists a computable martingale that succeeds on any strictly positive walk. Splitting this martingale into a product of two martingales (odd/even) corresponding to the two individual players, we have that one of the split martingales must also succeed, revealing in the cheater and thus telling us that his subwalk is not online-random in the ML-random sense.
[1] https://web.archive.org/web/20160703220408/http://www.personal.psu.edu/jmr71/talks/rute_2012_penn_state.pdf
[2] https://math.berkeley.edu/~slaman/papers/mlreals.pdf
|