TheRPGSite

Pen & Paper Roleplaying Central => Pen and Paper Roleplaying Games (RPGs) Discussion => Topic started by: 837204563 on November 12, 2010, 11:36:00 PM

Title: Game Analysis Puzzler
Post by: 837204563 on November 12, 2010, 11:36:00 PM
Here is a quick (somewhat mathematical) puzzle for your inner munchkin:

Consider two abilities, A and B, which are the same in all regards except for the damage they do.  Ability A does a flat 100 damage.  Ability B is more complicated.  By default it does 1 point of damage.  But when it hits you get to flip a coin.  If it is tails you do nothing.  If it is heads you double the amount of damage the ability would have done and repeat the process.  For example: You get three heads followed by a tails: the ability does 8 points of damage.  You get a tails: the ability does 1 point of damage.  You get two heads followed by a tails: the ability does 4 points of damage.

Which ability does the min-maxer choose for their character, assuming they have a choice between just these two abilities, and assuming they are trying to deal as much damage as possible?  The mathematical answer feels wrong in this case, but is it?
Title: Game Analysis Puzzler
Post by: danbuter on November 12, 2010, 11:45:18 PM
A. It's not even a hard decision. You'd need 7 successes to even get 100 points damage.
Title: Game Analysis Puzzler
Post by: 837204563 on November 12, 2010, 11:48:56 PM
Quote from: danbuter;416915A. It's not even a hard decision. You'd need 7 successes to even get 100 points damage.

Oh .. but what is the average damage for B?  This is where the fun comes in.  (hint, it's greater than 100, by a lot)
Title: Game Analysis Puzzler
Post by: danbuter on November 12, 2010, 11:55:56 PM
For B, you'll be lucky to get 3 successes in a row, so I bet the average is around 4. Since you stop at the first tails (unless you are changing the rules).
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 12:04:24 AM
The average for B is infinity.  1/2*1 + 1/4*2 + 1/8*4 + 1/16*8 + ... = 1/2 + 1/2 + 1/2 + 1/2 + ... = inifinity.

For an explanation see: http://plato.stanford.edu/entries/paradox-stpetersburg/  it's a classic paradox.  But I thought some of the more mathematical minds here might have an opinion on it.
Title: Game Analysis Puzzler
Post by: danbuter on November 13, 2010, 12:17:56 AM
I thought you said you do nothing (implying you stop flipping coins) on the first tails?
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 12:28:21 AM
Quote from: danbuter;416928I thought you said you do nothing (implying you stop flipping coins) on the first tails?

That's correct.
Title: Game Analysis Puzzler
Post by: Bloody Stupid Johnson on November 13, 2010, 12:43:10 AM
Well the math looks correct, though initially I didn't believe it either.
100 damage vs. the doubling damage, I'd have to take the 100. The chances of getting more than that are sufficiently small that I'd say 100 reliably is better. If you're actually trying to calculate relative worth of possible infinite damage - the maximum 'real value' of the damage is the hit points of the monster you're trying to kill, the overkill is irrelevant.
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 12:50:36 AM
Quote from: Bloody Stupid Johnson;416938Well the math looks correct, though initially I didn't believe it either.
100 damage vs. the doubling damage, I'd have to take the 100. The chances of getting more than that are sufficiently small that I'd say 100 reliably is better. If you're actually trying to calculate relative worth of possible infinite damage - the maximum 'real value' of the damage is the hit points of the monster you're trying to kill, the overkill is irrelevant.

Perhaps this is the real trick, isn't it?  The question looks complete, but you actually need to know the typical monster hp to have an answer.  Does this show that there is something wrong with the way we typically analyze the worth of abilities though?  I, for one, always simply consider chance*damage to work out what is better than what.  But if we should be considering the possibility of wasted damage from overkill the math would become much more complicated ...
Title: Game Analysis Puzzler
Post by: Bloody Stupid Johnson on November 13, 2010, 01:27:49 AM
Well, as you say, there may be more to min/maxing that just average damage. This is kind of a weird 'edge case' though there may be other cases where again, overkill is a factor; minions in some systems being the first that comes to mind.

Replacing the continually overflowing values with a fixed HP rating that's 'monster maximum' for a system seems to give a much better estimates, though.  I don't know exactly how to calculate the sum mathematically (there's probably a shortcut formula) but if you limit maximum value to even 50,000 (e.g. World of Synnibarr HPs), the unlimited roll up seems to be converging at an "average" value of only about 9 points. Drop the HP limit to 1024 (D&D esque), and it drops to a value of about 6.
Title: Game Analysis Puzzler
Post by: FrankTrollman on November 13, 2010, 01:29:26 AM
It depends on the number of hit points enemies have. If enemies have one hundred hit points or even one thousand hit points, you'll kill them faster hitting them for one hundred at a time. Back of the envelope, it looks to me like you on average take out enemies faster with a breakpoint at about twenty five thousand hit points. Which very few games are going to give to any enemy.

-Frank
Title: Game Analysis Puzzler
Post by: Kyle Aaron on November 13, 2010, 01:41:58 AM
I would go for 100 since if I sit there flipping a coin all night the other players will get pissed off, quit the campaign, and then it won't matter how awesome my character is, I won't be playing them any more.

That's the sort of thing missing from your analysis, what actually happens at the game table. If you're going to ignore what actually happens at the game table you may as well head over to the Forge.
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 02:14:54 AM
No Kyle, it is you who is overlooking what happens at the game table.  Because if flipping the coin takes any appreciable amount of time that means someone has hit a long sequence of heads, which would probably be the most exciting thing to happen all night.  Thus we can conclude that for the sake of entertaining the table with the hope of statistically improbable successes that turn the tide of battle in an instant (which is more dramatically exciting as well, especially compared to constant damage) the only reasonable choice is to pick ability B.  That is, if we ignore the mathematics, as you suggest.
Title: Game Analysis Puzzler
Post by: Cole on November 13, 2010, 02:21:01 AM
Quote from: 837204563;416957No Kyle, it is you who is overlooking what happens at the game table.  Because if flipping the coin takes any appreciable amount of time that means someone has hit a long sequence of heads, which would probably be the most exciting thing to happen all night.  Thus we can conclude that for the sake of entertaining the table with the hope of statistically improbable successes that turn the tide of battle in an instant (which is more dramatically exciting as well, especially compared to constant damage) the only reasonable choice is to pick ability B.  That is, if we ignore the mathematics, as you suggest.

In my opinion more than two or three flips is going to feel like a frustratingly long time, and if a hot streak of coin flips is the most exciting thing to happen in your game session, that is in and of itself a problem.
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 02:23:28 AM
Quote from: Cole;416958In my opinion more than two or three flips is going to feel like a frustratingly long time, and if a hot streak of coin flips is the most exciting thing to happen in your game session, that is in and of itself a problem.

Hey, I share your feelings, but in my experience people get (unjustifiably) exited by crits.  And once when we were playing with a three-consecutive-twenties-is-a-kill rule, and when that extremely improbable event happened people were talking about it for a while.  But really I was just trolling Kyle who was willfully missing the point of a silly mathematical puzzle.
Title: Game Analysis Puzzler
Post by: Pseudoephedrine on November 13, 2010, 02:47:39 AM
Quote from: 837204563;416959Hey, I share your feelings, but in my experience people get (unjustifiably) exited by crits.  And once when we were playing with a three-consecutive-twenties-is-a-kill rule, and when that extremely improbable event happened people were talking about it for a while.  But really I was just trolling Kyle who was willfully missing the point of a silly mathematical puzzle.

We had a similar house rule. I found it extremely exciting when it did occur, and can remember most of the instances when it did (twice for me personally - once on a demigod robot at the campaign climax, and once using the Magic Sword spell on an ancient red dragon).
Title: Game Analysis Puzzler
Post by: kryyst on November 13, 2010, 10:00:44 AM
The problem with your math is you are looking at statistical average.  The reality is that the results of the second coin flip have no baring at all on the first.  There is always a 50% you'll bust out on each flip.   While there is a statistical possibility you'll flip 7+ head in a row and score your uber damage.  The odds are stacked against you.  While you calculated the odds of success the odds of failure are the same.  

The 100 damage in this case is by far the better choice.
Title: Game Analysis Puzzler
Post by: FrankTrollman on November 13, 2010, 11:39:04 AM
Quote from: kryyst;416990The problem with your math is you are looking at statistical average.  The reality is that the results of the second coin flip have no baring at all on the first.  There is always a 50% you'll bust out on each flip.   While there is a statistical possibility you'll flip 7+ head in a row and score your uber damage.  The odds are stacked against you.  While you calculated the odds of success the odds of failure are the same.  

The 100 damage in this case is by far the better choice.


That is the stupidest thing I have ever read. I think the entire universe may have gotten more stupid just by me having read that.

No one is ignoring the chances of busting. The chances of busting are built into the chances of not busting. The chances of busting and not busting always add up to 100%.

The issue is exclusively how many attacks it takes you to defeat an enemy. With the coin flip option you have a very tiny chance of defeating any enemy every time you attack. With the 100 damage option there is a specific number of attacks that any enemy will take to drop. If the number of attacks that the straight damage option is going to take is very high (in excess of 100), then the chances of dropping an enemy in one spectacular uber hit before attacking that many times is more than 50% and the coin flipping option is "better".

The issue is not the math. The issue is not your chance of going bust. The issue is 100% the fact that the break even point where you are more likely to kill your enemy faster with the coin flipping option is a point that few game designers will inflict on their players because very large numbers of attacks being required to drop enemies is tedious.

-Frank
Title: Game Analysis Puzzler
Post by: kryyst on November 13, 2010, 01:09:11 PM
You are a fucking idiot.   Yet we are in agreement, 100pts is the better option unless an enemy has so many hit points that the only probably way of defeating them is to luck out.   So your point is what exactly - to yell at the wind?
Title: Game Analysis Puzzler
Post by: danbuter on November 13, 2010, 01:18:18 PM
Statistics lie.

Or, as has been stated several times, your odds of even doing 100 points of damage with the coin flip method are minute. Please start flipping a coin and post when you get seven heads in a row.
Title: Game Analysis Puzzler
Post by: ggroy on November 13, 2010, 01:21:50 PM
Quote from: kryyst;417030to yell at the wind?

Some people genuinely enjoy "yelling at the wind".

Just turn on the television to any cable 24 hour news channel, or daily talk shows on the radio.  :rolleyes:
Title: Game Analysis Puzzler
Post by: danbuter on November 13, 2010, 02:03:50 PM
Please don't post politics. "No politics" is one of the reasons I like this site.
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 05:38:29 PM
The math isn't wrong.  Please click on the link I provided earlier for a full explanation by people with PhDs.  I doubt that they are wrong.
Title: Game Analysis Puzzler
Post by: danbuter on November 13, 2010, 06:56:54 PM
So you managed to get 7 heads in a row already? How many tries did it take?
Title: Game Analysis Puzzler
Post by: 837204563 on November 13, 2010, 07:20:41 PM
1, probability is a bitch, ain't it.  But that is irrelevant to the mathematics, as you surely are aware.
Title: Game Analysis Puzzler
Post by: Bloody Stupid Johnson on November 13, 2010, 07:24:42 PM
Quote from: Kyle Aaron;416947I would go for 100 since if I sit there flipping a coin all night the other players will get pissed off, quit the campaign, and then it won't matter how awesome my character is, I won't be playing them any more.

That's the sort of thing missing from your analysis, what actually happens at the game table. If you're going to ignore what actually happens at the game table you may as well head over to the Forge.

You could replace the coin flips with a custom d8, labelled 1,1,1,1,2,2,3,4.
On a 4, reroll and multiply.


Every copy of the St Petersberg RPG boxed set could come with a few of these...

Quote from: danbuter;417061Please don't post politics. "No politics" is one of the reasons I like this site.

...and a pre-painted Lenin miniature ;)
(Sorry, couldn't resist)
Title: Game Analysis Puzzler
Post by: Doom on November 14, 2010, 12:41:13 AM
The math is right, you 'expect' to deal more damage with the flipping method.

Unfortunately, you're only likely to be 'near' infinity (or at least really really high) after you've made an infinite number of attacks (or at least a really really large number of attacks, for the picky). When you consider that most of the damage will be 'wasted' (much like using a daily power on a minion on 4e), there's no real benefit to the flipping method.

There's a question of utility that needs to also be considered. This is why a lottery ticket, even though a losing proposition, really isn't that bad (at least for a single purchase). What you're doing to your finances at the loss of a single dollar is insignificant to what an extra 50,000,000 dollars could do for you. Putting a year's pay into tickets on the other hand...

You'd be advised to study a mathematical concept called a "martingale" if you want to begin learning about these things.
Title: Game Analysis Puzzler
Post by: 837204563 on November 14, 2010, 01:53:32 AM
Quote from: Doom;417145Unfortunately, you're only likely to be 'near' infinity (or at least really really high) after you've made an infinite number of attacks (or at least a really really large number of attacks, for the picky).

This is literally the classic gambler's fallacy (http://en.wikipedia.org/wiki/Gambler%27s_fallacy) A high result is not more likely after a large amount of attacks than it is on the first attack.  You are, of course, more likely to see a high result in a large sample set than in a small sample set, but this is irrelevant to the expected value.  And so how many times you use the ability is irrelevant to the value of the "St. Petersburg power".  (Buying more lottery tickets means you are more likely to get a winner, but since buying another ticket doesn't affect the expected results of the other tickets it doesn't raise the value of buying tickets.  Similarly, one use of the power doesn't affect any of the others, so how many times you get to use it doesn't change its expected value.)  

Quote from: Doom;417145There's a question of utility that needs to also be considered. This is why a lottery ticket, even though a losing proposition, really isn't that bad (at least for a single purchase). What you're doing to your finances at the loss of a single dollar is insignificant to what an extra 50,000,000 dollars could do for you. Putting a year's pay into tickets on the other hand...

Of course if you reason like this you are open to a sorites paradox ...

Quote from: Doom;417145You'd be advised to study a mathematical concept called a "martingale" if you want to begin learning about these things.

The St. Petersburg paradox involves a single gamble, the martingale with an infinite series of bets.  The St. Petersburg paradox is paradoxical because a rational gambler should (in some sense) be willing to pay any amount for a single shot at the game regardless of whether further gambles are allowed.
Title: Game Analysis Puzzler
Post by: 837204563 on November 14, 2010, 02:07:18 AM
Also, if you flip the coin 100 times total for the night (not unreasonable given that many uses would have you flipping more than once) the odds of a 10 heads streak (1024 damage) are a little under 10%.  See: http://wizardofodds.com/askthewizard/images/streaks.pdf
Title: Game Analysis Puzzler
Post by: Koltar on November 14, 2010, 02:38:53 AM
Shouldn't this whole 'puzzler' be in the Design & Development section?

Seems to be an awful lot of math & mechanics and very little roleplaying to it all.

Just wondering.


- Ed C.
Title: Game Analysis Puzzler
Post by: Xanther on November 14, 2010, 03:13:52 AM
Quote from: 837204563;416922The average for B is infinity.  1/2*1 + 1/4*2 + 1/8*4 + 1/16*8 + ... = 1/2 + 1/2 + 1/2 + 1/2 + ... = inifinity.

For an explanation see: http://plato.stanford.edu/entries/paradox-stpetersburg/  it's a classic paradox.  But I thought some of the more mathematical minds here might have an opinion on it.

The average isn't the number you want.  This is a highly skewed distribution, you'll likely want the mean as a more valid measure, and that won't be anywhere near infinity, or a hundred I bet.  The average is a worthless number here.
Title: Game Analysis Puzzler
Post by: FrankTrollman on November 14, 2010, 05:24:16 AM
Quote from: 837204563;417153This is literally the classic gambler's fallacy (http://en.wikipedia.org/wiki/Gambler%27s_fallacy) A high result is not more likely after a large amount of attacks than it is on the first attack.  You are, of course, more likely to see a high result in a large sample set than in a small sample set, but this is irrelevant to the expected value.  And so how many times you use the ability is irrelevant to the value of the "St. Petersburg power".  (Buying more lottery tickets means you are more likely to get a winner, but since buying another ticket doesn't affect the expected results of the other tickets it doesn't raise the value of buying tickets.  Similarly, one use of the power doesn't affect any of the others, so how many times you get to use it doesn't change its expected value.)  

No. That's not Gambler's Fallacy. The larger the number of attempts you take, the larger the chances of getting a very large pile of doublings. The random damage pays off if and only if you would get a very large number of doublings on a single attack within the projected number of attacks you would have to make anyway.

Literally and specifically with the flipping method, you get higher damage expectations per attack the more of them you are having to make. So for example, if your opponent has only 3 hit points you have a 1 in 4 chance of eliminating them in 1 attack and a 1 in 4 chance of eliminating them in 3. The effective average damage thus is 1.75 per attack. If your opponent has 5 hit points, you have a 1 in 8 to do it in one hit, a 7 in 16 to finish the job in 2, a 3 in 16 to do it in 3, a 3 in 16 to complete in 4, and a 1 in 16 to finish in 5 hits. For an average real damage of 2.33 per attack. And so on.

The more attacks you expect to make, the more damage you average per attack. Your expected damage per attack is only actually infinite when your target has infinite hit points and you have to attack them an infinite number of times. At any real number of hit points you actually have chances of delivering the goods in various numbers of attacks, meaning that you have an actual finite average effective damage. And the more attacks you'd be expected to make, the higher that average is per attack.

If you were playing a video game and fighting some boss with millions of hit points such that you'd have to click the attack button tens of thousands of times either way, the random damage would pay off. Most of the attacks would seemingly have no effect on the enemy health bar, but a few times you'd see a huge dip from some kind of critical hit and you'd on average have to click less times.

Bottom line: it's not gambler's fallacy. The way the limitations of the problem are set up, you actually do get different expectations and break even points depending on how many times you repeat it.

-Frank
Title: Game Analysis Puzzler
Post by: Halfjack on November 14, 2010, 12:07:11 PM
Quote from: Xanther;417161The average isn't the number you want.  This is a highly skewed distribution, you'll likely want the mean as a more valid measure, and that won't be anywhere near infinity, or a hundred I bet.  The average is a worthless number here.

I don't think that "average" even has a precise definition, does it? It looks like he's calculating the expected value (which in this case is an infinite series). I don't think the mean will help any either as you don't have a finite data set. Worse, if you just brute force it with a Monte Carlo, you will get potentially radically different results per run. Fact is, this is just a case where the EV is not a good measure.

Here's what I would care about: what are the repercussions of failure? Because with this method you will fail a lot between huge successes, and if failure means death, then it doesn't matter what would have happened next time.
Title: Game Analysis Puzzler
Post by: Doom on November 14, 2010, 04:14:10 PM
Quote from: 837204563;417153This is literally the classic gambler's fallacy (http://en.wikipedia.org/wiki/Gambler%27s_fallacy) A high result is not more likely after a large amount of attacks than it is on the first attack.  You are, of course, more likely to see a high result in a large sample set than in a small sample set, but this is irrelevant to the expected value.  And so how many times you use the ability is irrelevant to the value of the "St. Petersburg power".  (Buying more lottery tickets means you are more likely to get a winner, but since buying another ticket doesn't affect the expected results of the other tickets it doesn't raise the value of buying tickets.  Similarly, one use of the power doesn't affect any of the others, so how many times you get to use it doesn't change its expected value.)  

Of course if you reason like this you are open to a sorites paradox ...

The St. Petersburg paradox involves a single gamble, the martingale with an infinite series of bets.  The St. Petersburg paradox is paradoxical because a rational gambler should (in some sense) be willing to pay any amount for a single shot at the game regardless of whether further gambles are allowed.

There's massive confusion on terms and applications here, so I'll try again. Common to analysis in a distribution is to look at the mean (which you are), and the standard deviation (or variance, if you prefer), and the latter has been neglected. In the short term, the mean becomes less and less useful as the standard deviation increases. Yes, the probability of rolling 'infinity' on the first hit is the same as on the 1,000th, but that's NOT how a min-maxer makes his decision, he has to consider how likely it is to roll so high, as well.

A high mean for damage is nice, but it might do no good if the standard deviation is high. In the coin tossing damage case, the standard deviation is also infinite, which makes analysis difficult (and, incidentally, most results in probability theory void). The "high" standard deviation means that you're not getting results near the mean (infinity) much at all.

Suppose, for example, we toss in an extra detail: if you 'deal' less than 1,000 points of damage, then the monster is instead retroactively granted 2^128 temporary hit points.

The mean damage you deal is STILL infinite, so by your reasoning coin-tossing damage is still superior. On the other hand, I hope,  it's painfully obvious that the coin-tossing way of dealing damage is a bad deal, so, by contradiction, I hope I've hinted at the problem:

Mathematically, you're still dealing an expected damage of infinite with each hit, but now slaying a single monster could easily take 2^129 rounds of combat...now we're back to utility.

The mean, by itself, in this particular situation, really doesn't tell the story, and this is above and beyond the fact that monsters never have an infinite number of hit points anyway, making the 'tail end' of your damage a moot point in every single applied circumstance.
Title: Game Analysis Puzzler
Post by: Benoist on November 14, 2010, 06:24:56 PM
Quote from: Kyle Aaron;416947I would go for 100 since if I sit there flipping a coin all night the other players will get pissed off, quit the campaign, and then it won't matter how awesome my character is, I won't be playing them any more.

That's the sort of thing missing from your analysis, what actually happens at the game table. If you're going to ignore what actually happens at the game table you may as well head over to the Forge.
This.