Hacker News new | past | comments | ask | show | jobs | submit login
Parrondo's Paradox: How two ugly parents can make a beautiful baby (datagenetics.com)
130 points by pavanlimo on Aug 23, 2012 | hide | past | favorite | 62 comments



Isn't it a little sketchy to have one of the "games" be a game that takes into account outside information like your balanace?

Here's another "paradox":

Game A: You lose a dollar every time.

Game B: If the last game you played was game A, you win a million dollars. Otherwise, you lose a dollar.

AAAAAAA... loses, BBBBBBB... loses, but ABABABABA... makes you rich!

Suddenly it doesn't seem so paradoxical to me.


Even if you don't want the games to be able to refer to the last game you played, it looks like this is greatly convoluted. Why not just consider something simpler like the following?

Game A: If you have an even number of chips, gain one. Otherwise, lose two.

Game B: If you have an odd number or chips, gain one. Otherwise, lose two.

The point being that game A (or B) always leaves you with an odd (or even) number of chips, so that if you keep playing it you lose two every turn, but if you alternate, you win one every turn (after the first, possibly). For simplicity, I'm ignoring the behavior near zero chips, but this still seems to capture the essential properties of the "paradox" in a much simpler fashion.


Exactly - most of the effort was making a game that hid that simple mechanic so that it took some (admittedly interesting) math to figure out where the dependence was.


The author does say that the Parrondo's paradox only works if the games are not independent. It still is paradoxal that "A combination of losing strategies becomes a winning strategy".


It's only 'paradoxical' when the details of the games are sufficiently obscured.

If you word it as "a combination of losing strategies becomes a winning strategy" many people will be surprised and ask you to explain.

If you word it as "losing in A adds to the prize in B, so playing both beats the house" people aren't going to be impressed. note: used a simpler A/B mechanic than the blog post for illustration purposes


That's what "paradox" is: when a simple model or explanation seems to show a contradiction, and a more sophisticated model is needed to understand the situation.


But in this case the 'simple model' is less 'simple' and more 'misleading'. Something should be a paradox without trickery. Someone hiding invalid division to make 1=2 is not a paradox. "Set of sets that don't contain themselves" is a paradox.


If they were independent, it would be impossible: E(X + Y) = E(X) + E(Y) if X and Y are independent. (where E(X) = E(x | X=x) is the expected value of a random variable). This is easily provable: E(x | X = x) = \integral_{-\inf}^{inf} x f_X(x) dx, and by integration by parts:

  \integral_{-\inf}^{inf} \integral_{-\inf}^{inf} (x + y) f_X(x)f_Y(y) dx dy = \integral_{-\inf}^{inf} f_Y(x) \integral_{-\inf}^{inf} x f_X(x) dx dy + \integral_{-\inf}^{inf} f_Y(y) \integral_{-\inf}^{inf} x f_X(x) dy dx = \integral_{-\inf}^{inf} f_Y(y) dy \integral_{-\inf}^{inf} x f_X(x) dx + \integral_{-\inf}^{inf} f_X(x) dx \integral_{-\inf}^{inf} y f_Y(y) dy
Since p.d.f.s f_X(x) integrate to 1 over their domain,

\integral_{-\inf}^{inf} f_Y(y) dy \integral_{-\inf}^{inf} x f_X(x) dx + \integral_{-\inf}^{inf} f_X(x) dx \integral_{-\inf}^{inf} y f_Y(y) dy = \integral_{-\inf}^{inf} x f_X(x) dx + \integral_{-\inf}^{inf} y f_Y(y) dy = E(X) + E(Y)

Therefore, if two games are independent, the expected loss is the sum of the expected losses. For real-valued expected losses, it is not possible to add two real numbers of the same sign and get a real number of the opposite sign, and so the 'paradox' is therefore impossible for independent games.

But you are right, for non-independent games, it doesn't seem that surprising, so it doesn't really meet the definition of a paradox.


Linearity of expectation applies to any two random variables, not just ones that are independent. The issue is that these games are not random variables, they are random processes (sequences of random variables) with state affected by the choices you make and previous outcomes. Linearity of expectation is irrelevant.


I was thinking the same thing. Is there a version that makes it a paradox?


No.


Your balance isn't really outside information. In a game like Texas Holdem Poker, your balance is a key factor in how much you bet.

But if we change the game so that "if you flip more than two heads in a row, your chances of flipping a third head are only 10%; if you flip two tails in a row, your chances of flipping a third tail are 90%", the result is the same, the odds turn more negative over time than Game A and you should switch to A after two consecutive flips.


It's not your balance that matters there, it's the amount of money you choose to bring into the game at the start. If I could boost my odds by bringing in only $498 dollars of my five hundred then I would do so every time.

Your actual balance is ridiculous to include in a game's calculations.


In texas hold'em your actual balance is a very significant factor in your optimal behaviour in a particular hand. Short-stack tactics are different to big stack tactics.


Okay, I didn't make myself clear enough. Let's say you have a thousand dollar bill in your hand. You decide to convert $600 into chips because that's a multiple of three, and then you put $400 into your room safe. Your real balance is 1000, but your balance for the game is 600. Your stack tactics are based on the 600. Your chance of winning is based on the 600 you chose to bring. Anything that counted the 400 in your room vault would be ridiculous. Yet the game in the blog would.


But that's not quite the same thing. In your example, you can't play game B independantly :)


Yes you can; you just lose a dollar each time.


I was expecting something more along the lines of actual genetics, in which case two ugly parents make stunning children all the time. It is called hybrid vigor. The overwhelming amount of our produce is bred this way. They will inbreed corn like made so that it is 100% homozygous, but do it in five different pools. The resulting offspring of any two inbreds from two different pools is amazing. Inbred corn plants are about 4-5 feet tall and ugly as sin, but their offspring are 8 feet tall and near perfect.


And if the parents aren't homozygous it could be attributed to recessive genes. Same reason why two brown-haired parents can have a blond child.


And if the parents aren't homozygous it could be attributed to recessive genes. Same reason why two brunettes can have a blond child.


It didn't seem like much of a paradox to me, since game B is really two different games, and interleaving plays of game A changes the likelihood of playing B1 vs. B2. Interesting, perhaps, but not terribly unintuitive.


Right. When I got to the part about Game B, my first thought was, "Wait, this isn't what you described in the story above..."

What a crock. I think the Monty Hall Problem (http://en.wikipedia.org/wiki/Monty_Hall_problem) is far more vexxing and interesting.


I think the Monty Hall Problem is also extremely misleading in its formulation.

Take Wikipedia's formulation for example: Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1 [but the door is not opened], and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

What's not being explicitly said here is that the host knows what's behind the doors (this part is said) but that he also always chooses the goat. With that information, it's pretty clear that when the contestant first made the choice of a door, the probability of getting the right one was 1/3. The probability that the right door is among the other two is 2/3. NOW however, the host removes the one of (or the only) wrong option among those two doors. The thing to realize is that the host opening one of those doors does not give us ANY new information that would change the distribution. Therefore, the other door that the contestant didn't pick must have the probability 2/3.


It's true that that's the crux of the Monty Hall problem, but it's also the understood nature of it. You just don't realize how much impact that would have on the outcome unless you actually start delving into the outcomes.


I agree. Imagine that time is used (instead of current balance), and A pays out if the current second is divisible by three, and B pays out if it is one more than a multiple of three. A and B are both losing games if played every second, but it's not hard to combine them to win. And few people would call this a paradox.


the un-intuitive part is that the odds supposedly flip in your favor just by alternating 2 games with negative odds.


I'm not so sure; when you read the description for Game B it should be clear that it's odds rely on your balance, an external factor.

As that is something that can be manipulated then it isn't a major leap, I think, to the idea that combinations of the two games would produce different outcomes - and that some outcomes would be positive.

Whilst fun; I rather preferred the latter part of the post - it reminded me of a brilliant book I had as a kid with many such puzzles in it :)


In the other examples at the bottom tucked in there is a great example of how seemingly negative things can actually turn out to be a positive thing, this example is talking about the board game chutes and ladders.

  I explained the seemingly paradoxical situation where it is 
  possible to add additional chutes to a game board and 
  reduce the average length of a game! How come? Well, if you 
  have a long ladder in the game (such that landing on one 
  will propel you far up the board for a strong advantage), 
  and you miss it; If the added additional chutes on the   
  board send you back to before this long ladder, then you 
  have a second attempt to hit the long ladder!
wow- I love this, it supports the notion to 'fail early' in business


As much as I like coin-flipping examples, I think the Brownian ratchet (http://en.wikipedia.org/wiki/Brownian_ratchet) is a much clearer explanation of this phenomenon.


Uh... Something's fishy with the first graph of the 'drunken man's walk'. It's well known that the random walk veers away from the zero-line at a rate sqrt(N), where N is number of flips. Normalized by the number of flips, the random walk converges to the zero-line at the rate 1/sqrt(N). The graph does neither, so I'm not quite sure how it was generated...


Oops, I misinterpreted how the graph was generated... but the complaint still holds. The averaging of a million trials will cut the amplitude of the fluctuations by a factor of 1000, but the sqrt(N) effect should still be visible. (Note that if you multiply the Y-axis by sqrt(million) = 1000, then you get a scale of about 20, which is approx sqrt(500))


I'm not very good at this stuff, but I don't see anything wrong with the graph. It hovers around 0. A Brownian motion starting which starts at 0, will, at time T be normally distributed with mean 0 and variance T.

http://en.wikipedia.org/wiki/File:Random_Walk_example.svg

Some of them go up, some go down, but all will cross 0 infinitely many times, and all the paths averaged will equal 0.


Can someone explain the uptown / downtown train story to me?

If the downtown train arrives and departs a few minutes after the uptown train arrives and departs, respectively, why would he take the downtown train more? It seems to me that if he missed both trains, then he would take the uptown train, as it would arrive earlier.


He is saying the opposite. The downtown train arrives on the hour and the uptown train arrives at 5 minutes after the hour.


The description has it the other way.

"The solution is that, even though the trains arrive with the same frequency, the downtown train departs just a few minutes after the uptown train has departed. Because of this, there is only a narrow time window in which the man is able to get on the uptown train."

s/after/before/ to fix the explanation.


No, he does not say the opposite:

>even though the trains arrive with the same frequency, the downtown train departs just a few minutes after the uptown train has departed. Because of this, there is only a narrow time window in which the man is able to get on the uptown train.

He should say it like you suggested though.


You're right. I was looking at the diagram. Clearly the author accidentally swapped the two names in that sentence.


You are correct, he messed up telling the story.


Babies are made through love, love is beautiful, ergo babies are beautiful. Q.E.D. (I read the whole post, it was an interesting read)


Extending your discussion, love is nothing but chemicals firing in our brain. Maybe human beings are evolved to trigger release chemicals in the brain when certain conditions are met, which could possibly be deterministic? I agree that each person is different, but we're all same in the same way. Think of the attraction to the opposite sex as a seeded random number. Sure, we don't know the seed but if you know a person well enough you're able to make fair judgement and confidently claim that "X isn't Y's type".

I'd love to continue discussion on this philosophical point. "Love" is afterall nothing but an abstract construct which has proven beneficial in furthering the species when we were being chased by lions and bears.


Love is "just chemicals" in the same way that anger is "just chemicals". The chemicals are the substrate, but to say that is not very informative. Analogously you also wouldn't say computer software is "just electrons". Beware of "nothing buttery"; reduction is a great thing, but only if we truly understand the reduction (as in, heat is movement of molecules).

Re: determinism, I expect the whole process to be non-deterministic through and through, such that say what you had for breakfast might as well have some amount of influence on your social interactions.


Indeed. Chemicals are the implementation. That doesn't mean they are the essence.

In fact, I think the design of a thing is closer to its essence than the implementation. Moonlight Sonata is neither just bits, nor just vinyl, nor just vibrating strings. In any implementation, it is Moonlight Sonata. The essence of it is the music, the information, Beethoven's intent and insight.

Love is the same way. Of course consciousness and will are implemented in chemicals. They have to be implemented in something. That does not make them less real.


I think you have a fair point. I might have become a bit too overzealous in my argument via reduction. But yes, anger is definitely "just chemicals" in the sense that some people get angry quicker than others.

Again, although I'm forced to concede your second paragraph that there might be some influence by what you've eaten yesterday, I'd like to believe that they're not that large. Because, if that were true everyone who'd eat (for instance) spicy things would constantly be in a state of irritation and anger.

People's temperament, moods, general thoughts might as well be a pre-seeded RNG.


HN seems to wake up to bitter pedants. Have an upvote.


I'm unable to reproduce the results. Balance is always negative. What's wrong with my code?

  // for a graph
  var balances = [];

  // constants
  var winnings =  1, 
      losses   = -1, 
      epsilon  = 0.05;

  function play(probOfWinning) {
      return Math.random() < probOfWinning ? winnings : losses;
  }

  for (var experiment = 0; experiment < 100; experiment++) {
      var balance = 0;
      for (var flip = 0; flip < 1000000; flip++) {
          if (flip % 3 == 0) { // game A
              balance += play(0.5 - epsilon);
          } else { // game B
              balance += Math.round(balance) % 3 == 0 ? play(1/10 - epsilon)
                                                      : play(3/4  - epsilon)
          }
      }
      balances.push(balance);
  }


The problem is you are using a rounding of the balance across the million tries to decide on game B. The choice of which game B to use need to not be dependent on the other experiments.


You are playing 100 games of 1 million rounds each.

The graph in the article shows the average state of each round over 1 million games.


> (I think I’ve probably lost a good number of people in this post already, so if you’re still reading this, I assume you’re familiar with Eigenvectors).

Actually, no! I was kind of hoping that by reading this section, I might find out about them. Why write a blog post section specifically targeted at those readers for whom it holds no new information? The responsible thing to do here, if you really didn't feel like explaining some key component of your discussion, would have been to provide a reference to someone else's explanation. Now it feels like you were wasting my time -- 'oh, hey kid, wasn't talking to you!'

Also, as others above have mentioned, the generalized introduction (a way to make 2 losing games into a winner!) does not lead intuitively into the extremely case-specific exposition.


Imagine if instead of Game B being dependent on your cash balance, let's say Game B is blackjack and your chances of winning depend on the number of 10s/face cards that have already been played.

If the collective number of 10s/face cards already played is <= 25%, you have a positive chance of winning and you play blackjack.

If the collective number of 10s/face cards already played is >= 35%, you have a negative chance of winning. You switch to roulette until the balance of 10s/faces works back in your favor.

I think that could be a winning strategy when playing blackjack and roulette together. LOL

Edited to add: I think the author's point is that there are games where you can calculate your chances of winning "this hand" even though your chances over time are negative, and you should avoid playing (switch to something where your chances are better) when your chances are low. Which is a bit of an obvious point for such a long article filled with graphs.


I think that could be a winning strategy when playing blackjack and roulette together.

Or you can get even more money by s/roulette/taking a nap/. You're just changing your bet size (including $0) in blackjack based on the current odds. No fancy 'combining two losing strategies'.


"The key to understanding this paradox is that the two games are not independent."

Well... can it really be called a paradox then? It's more of a classical failure at defining the problem since the probability distribution of B definitely depends on A - the description is just more convoluted, but it's not a contradiction.


I read the article and understood what he's saying - but how exactly do two ugly parents make a beautiful baby?


They don't. But two losing games (the parents) can be combined to make a winning strategy (the beautiful baby).

(I read the whole article til the end waiting to see what this had to do with genetics. It doesn't.)


What does the "mixed nuts" example at the bottom have to do with this phenomenon?


I am not sure whether the conclusion is right. But the explanation is lame since the second game depends on the your cash status which could be affected in a favored way to make the second game a winning one.


Struggling with this one. Help me out: If I play roulette and bet black, red, red, black, red, red, etc., I'm going to win?


One way to think about it is that there are really three games: game A (a slight loser), and games which I'll call BL (losing) and BW (winning). If you win a couple rounds of BW, the casino changes you to playing BL for a round. But if you don't play BL and instead go play A for a round, then when you come back to the table you'll be back to game BW. So you use game A, a slight loser, to avoid BL, a bad loser.

Playing only A is a slightly losing strategy. Playing a mix of BW and BL is a losing strategy, because BL is so harsh. But if you play BW mixed with A, you combine big wins with small losses, and therefore come out ahead.

This doesn't work in roulette because, no matter what color you play, it's a slight loser. Black and red are both examples of game A, so no matter how you mix them you're just playing AAAAAAAA.


But you don't loose on two tables equaly, so what if you play on two tables A and B, play ABBABB... and chose colors randomly?


That's an excellent explanation of what's actually going on in this situation. Thank you.


I think I understand now. Thank you!


Another concrete example is to define BL and BW as any point at which a game B has a negative or positive expectation. A real-life example of using the A, BL, BW strategy were the MIT blackjack teams of the 80's and 90's.

They had a spotter at each table that would count cards and wait until the odds were in the player's favor before calling in the big money player. Assuming that the bets placed by the spotter are negligible, the the big money player could choose from the following games:

   A : Do nothing. E[x] = 0  (break-even)
   BL: Play blackjack when the deck favors the casino, E[x] < 0
   BW: Play blackjack when the deck favors the player, E[x] > 0
Obviously playing blackjack has negative expectation in the long run, and we could choose another casino game with very-close-to even odds for game A (like Baccarat), rather than doing nothing.


With European roulette, you'll win 47.30% of the time. With American roulette, you'll win 44.74% of the time.

The same odds as always choosing black or red.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: