Can I Win?

Over the last couple years, I have been attempting to convince people that an app needs to be written which calculates how many “outs” you have to advance out of a finals round. Nobody bit, but recently I needed an excuse to learn some Javascript so I decided to write it myself. You can play with it here:

http://heyrocker.com/caniwin/

Currently it makes some assumptions:

  1. Best two in the group advance
  2. You are heading into the last game of a round, it doesn’t work heading into game 3 of a Pinburgh finals round.
  3. That there is another round still to come, so it doesn’t work to calculate odds of a win when you’re in final four.

That said, I think it is kind of neat. It also probably has bugs, so please test it! If anyone wants to help work on it, that might be able to happen, but boy I’m sure the code is awful. I think the next step would be to list exactly what needs to happen for each result, making it even easier to sweat over exactly what is and isn’t going right at any given moment.

Enjoy!

10 Likes

Math is hard, now I have an app!

This will be good for commentators. Good job, Greg.

2 Likes

Ha! This is cool. And would also assist with commentators and viewers of tourneys wondering what are the possible outcomes or “outs.”

I agree completely! Is that easy to implement?
To narrow the scope, I would only have the code/system provide the details (exactly what needs to happen) for the low probability possibilities for each player. In other words, in an 8-4-1-1 PAPA situation, only give an option to click on “Out” details for Player 3 and 4’s advance and tie scenarios (only 4 in total for each of them, and they’re going to be identical in structure), and perhaps provide detail option for Player 2’s Eliminated and Tie possibilities.

In terms of GUI: I’d have the details hidden, and turn the low probability scenarios for each players into hyperlinks that will then bring up that scenario’s possible alternatives.

Also, if you want to go one step further, do the same for the final 4 (how many possibilities to take 1st, how many possibilities to take 2nd). But I think simply having a web app to determine Advance possible scenarios is cool enough! Bravo! In which case, I’d rename the title of the app to “Can I Advance?” instead of “Can I Win?”

I started working on a similar system a few months ago (which I showed to @gdd, and haven’t done anything with since). My vision is exactly for commentators, as @PinballProfile pointed out, to have a real-time stream of talking points. As the game situation changes, the app would generate the most pertinent information to mention.

I had been listening to a lot of commentary and I was getting sick of hearing “math is hard” or wrong information being said. Yes, it is hard for most people but it’s totally possible to automate the calculations. Presenting the data and sorting the insights in an easy to understand way is the tricky part, IMO.

4 Likes

Yeah my experience commentating is exactly what inspired this. There’s no reason anyone should have to calculate this stuff on the fly while at the same time being engaging on the stream. Let the computers do the work they’re good at.

4 Likes

Haha, apparently I’m not the only one working on this. I have written the code to do the calculations, I just haven’t gotten around to putting the UI together.

This is what I’ve been working on for an output. It would show the placement probabilities for each player, given the number of games remaining in the round, and the current number of points they have. This could be integrated into the stream, or discussed by the commentators.

Ultimately it would be cool to take into account the ratings of the players to come up with more accurate predictions.

Some fun facts:

  • on any given 4 player match, there are 24 possible outcomes.
  • In a four game round, there are 254,774 possible outcomes.
  • In a Pinburgh round, only 1440 of these outcomes result in someone getting a 12 (0.56%)
5 Likes

For reference here is a link to my system: http://oddchange.com/finaldraw
Also the source code is here: http://oddchange.com/src/finaldraw.py

The presentation is ugly, but maybe the logic is useful. I’m not working on this anymore so certainly @gdd or anyone else is welcome to use this.

The current round of game scores can be entered, in addition to previous rounds’ points. As a player is mathematically locked into a win/loss, this is taken into account.

Raw probabilities are first computed, like the graphs above. Ties are treated as separate categories. (A position of 1.1 means 1st place tied with one other person. This is distinct from 1.0 and 2.0).

Then the set of all possible advancing players is calculated. Ties may or may not matter, e.g. a tie between 1st/2nd is irrelevant in a top 2 of 4.

Last the advances per player are calculated. For each player the outcomes are advance, no advance, or tie.

3 Likes

I have a big Excel file with lots of stuff like this in it. {and historical IFPA rankings, machine notes, event results and …}.

I’ve spliced out the relevant sheet if anyone wants to play with this instead. One thing I do have that the other versions don’t is the relative chance that a given player will need to play in a tiebreaker to get in. If it’s now 8-4-2-0, then player 2 has 4 scenarios of the 24 final game results where they’re eliminated, 15 where they get in “clean,” and 5 where they’ll have to survive a tiebreaker. Their chance of getting in clean is 63%, total chance to advance is 72%, and the portion of their “outs,” to use the poker term, that involve a tiebreaker is 25% or 5 out of 20.

(Note the 25% is NOT the same as the chance that they had to go through a tiebreaker, given that they got in. But that’s more math than the viewer needs.)

Hmm, system wouldn’t let me upload an Excel file, here’s a pdf version of the summary section. Not as useful as the UI versions, but you could just print it as a cheat sheet.

One thing to note about Brian’s version is it handles the slight differences in outcomes depending on the scoring system used, i.e. 4-2-1-0 vs. 7-5-3-1.

Redundant efforts abound, or GMTA.

PAPA Points.pdf (371.9 KB)

1 Like

You might also check that the scores are possible and throw an error if they aren’t to prevent fat fingering mistakes.

Example:
4
2
1
2

Should throw an error under papa scoring. (At least I think it should. Unless it makes sense to update mid-round. )

This thread inspired me to finish my app: https://philgrimaldi.shinyapps.io/PinballWinProb/

Still laughing about how many people have been independently working on essentially the same thing! One difference in my approach is that I did not focus on ties. Mostly because I was lazy. I was really just going for some additional visual information that could be put on screen to give a quick overview to the viewer. I think it’s always interesting watching poker when they show a hands odds of winning. Its good for the viewer to know the stakes.

After reading this thread, it seems like there is also a demand for giving explicit paths for the commentators to address (i.e., “if p1 gets last, and p2 wins, we could have a tiebreaker”). Might have to address that in future updates.

3 Likes

Excellent! Using your probability outputs by placement (1st - 4th), for calculating Advance vs Eliminated in a 2 advance / 2 eliminated situation, all you have to do is add up the 1st & 2nd for each player to get Advance total probability, and add up 3rd and 4th to get the Eliminated probability, correct?

Hmmmm. but as you mention, yours doesn’t account for probability of tie for 1st, tie for 2nd, and tie for 3rd. Tie for 3rd isn’t all that important, so I wouldn’t spend any time on it.

Sorta. Adding the probabilities for 1st and 2nd would give you the probability of getting either first or second (tied or cleanly). So not necessarily the probability of advancing. In my app, a tie for first is treated the same as earning first place cleanly.

Stats are cool, more stats!

Ah, this is really cool! I’ve been working on learning how to do this crap in my head, especially since a west coaster got in my face at the last PAPA and told me how stupid I was for ruining his experience by discussing the math for who needed what in a small group of people.

Thanks for making me less stupid, Greg!

All right, no one else has said it so I’ll bite.

WTF?

3 Likes

Definitely one of the more humiliating experiences I’ve had, and I’m not sure I’ll ever forget it. I kept forgetting who had what moreso than struggling with the math (I calculate numerous rates/dosages for drug administration on a daily basis - this is not a deficiency).

I guess simply talking about it upset the guy.

¯_(ツ)_/¯

1 Like

I used can I win several times several times this weekend. In each case I probably would have worked it out eventually, but this was faster and less effort. Thank you.

Looking forward to seeing one of the tournaments stream with these automatically added to the player cards, that would be great for viewers at home.

5 Likes

Resurrecting this thread! I caught a moment of inspiration to update my app so that it now lists out the specific events that need to happen in order for a player to get first or second, either cleanly or through a tie. I hope this will be useful for commentators and players alike. I recently fudged the math while commentating on stream and said something like “so and so is eliminated” when they were actually still in it. Maybe this will save me and others some future embarrassment!

https://philgrimaldi.shinyapps.io/PinballWinProb/

Please let me know if you find any errors. I checked a bunch of scenarios and test cases, but bugs are my specialty.

6 Likes

I see a pro app on the horizon to calculate equity for settlements :slight_smile: