Showing posts with label probability. Show all posts
Showing posts with label probability. Show all posts

Friday, January 6, 2012

2011 NFL Playoffs: Are the Patriots Better Off as a #1 or #2 Seed?

I'm a fan of the New England Patriots. During the past few weeks it became clear that the Patriots were going to be in the NFL playoffs as either the #1 or #2 seed. I've heard opinions expressed both ways as to which seed is preferable. Some argued that the #1 seed is better as it means home field advantage throughout the playoffs while others argued that the #2 seed was preferable as the Patriots would likely avoid playing the strong #5 seed in the 2nd round (Baltimore or Pittsburgh) followed by playing the #2 seed in the 3rd round (Baltimore or Pittsburgh). So do the Patriots have a better chance of making the Super Bowl being the #1 or #2 seed?

Sunday, May 15, 2011

More Memory Game

This post is an attempt to answer the question I posed in a prior post about the Memory Game. If you are not familiar with the Memory Game, you can read that post to get familiar with the rules and terminology. The question:
With the second part of your turn, if you do not have a 100% chance of getting a pair is it better to flip an already known tile or try to flip an unknown tile?
As I explained in my prior post on Memory, there are two ways to score. The first method of scoring is to flip over your first tile and already know the position of its match on the board. The second method of scoring is to flip over your first tile, not know the position of its match, and then randomly guess and find its match. My question asks should you forgo the second method of scoring pairs? 

Sunday, May 1, 2011

Memory Game

In the seventh episode of this season (22nd) of Survivor, two contestants played the Memory Game to see who would remain on the show. In the Memory Game you score points by flipping over pairs of the same card. Whoever identifies the most pairs wins. The Survivor version had 20 tiles (10 unique pairs) laid face down. The contestants took turns flipping over two tiles per turn. If you flipped over identical tiles (a pair) you received a point and those two tiles were removed from the game. If the contestant flipped over non-identical tiles, the tiles were returned to their face down position. The players alternated turns regardless of whether they scored a pair or not. First to get five pairs won the game. Watching the game, I had two questions:

  1. Is it better to go first or second?
  2. With the second part of your turn, if you do not have a 100% chance of getting a pair is it better to flip an already known tile or try to flip an unknown tile?



Monday, May 3, 2010

Fresh Meat II: The Challenge Episode #4

My earlier posts on the MTV reality show Fresh Meat II: The Challenge recommended two strategies for the competing factions in the show: one side should tighten the bounds in its group and keep loyalty strong while the other side should use the threat throwing a team into the elimination challenge as a way to get teams to defect to their faction. However the factions got the strategies backwards. I recommended Kenny's alliance use the threat of being sent into the elimination challenge to get someone to defect to his alliance. Wes's coalition had the superior numbers. It was in Wes's coalition's best interests to keep loyalty strong within the group. Instead Kenny let someone in his alliance choose who was going into the elimination challenge, thus trying to boost loyalty withing the group while Wes's coalition used the threat of being thrown into the elimination round to get a team to defect to his coalition.

Sunday, April 25, 2010

The Challenge: Fresh Meat II Wes's Coalition

With Wes's coalition in such a dominate position, the 7 teams in it have to start moving beyond the threat of Kenny's alliance (3 teams) and strategizing  for the end game. In particular two things: avoiding the elimination round and being one of the final four teams that gets to compete for the cash prize. As long as Kenny's alliance remains, Wes's coalition will keep choosing them to go into the elimination challenge. Wes's coalition could be left with 7 teams or it could lose a couple elimination challenges and be left with 5 teams when Kenny's alliance is down to one team. At that point Wes's coalition will have to turn on itself.

Sunday, July 20, 2008

The Basics of Poker

No post last week. The author was a bit worried that someone had give Martin another box of silver, but in fact it was the something quite different. Enough personal stuff, onto the math.

Say one was to go play a game of Texas Hold'em. What should the player know? Blackjack and craps have fairly simple strategies to follow to maximize expected play, or rather to minimize expected losses. For blackjack all someone has to do is remember a simple table. Poker is different. The basic requirement is to know the rules. What hands beat which hands, the order in which people bet, and generally how the game unfolds. Once the basics are learned, the two most important concepts are the Fundamental Theorem of Poker and bluffing. The fundamental theorem dictates that a player play his hand as if he could see everyone's cards and always applied the correct pot odds. Every time a player does this he increases his expected gain. Every time a player fails to do this, he is losing money.

Bluffing adds depth to poker. A player cannot follow the fundamental theorem perfectly. He can only guess what his opponents have. If a player plays his hand based on the fundamental theorem and never bluffs, his opponents will be able to accurately guess what cards he has and put him at a disadvantage. The skill in poker comes from balancing the concepts of the fundamental theorem and bluffing.

Those are the basics. Next it is important to get a sense for how often certain hands occur. Playing repeated hands of poker will give a player a good feel. A player gets two cards before he has to decide whether to play the hand or fold. What types of hands should a player ante up for and how often do those hands occur? Let us say a player likes to play the following types of hands: a pair, cards of the same suit that are adjacent (suited connectors), and two high cards (two cards that come from the set of 10, Jack, Queen, King, and Ace). Those are generally regarded as good hands to ante up on as they can lead to strong hands. Let the sets be defined as A for pairs, B for suited connectors, and C for high cards. The probability of getting one of those hands is the union of those three sets:

P(A U B U C) = P(A) + P(B) + P(C) -[P(AB) + P(AC) + P(BC)] + P(ABC)

Where 'U' indicates a union of sets and 'AB, ABC etc.' indicates an intersection of sets. For unions of sets, the basic rule is to add the sets of odd intersections and subtract the even intersections.

P(A) = probability of getting a pair. The first card can be anything. For a pair to occur the second card had to be one of the 3 remaining cards from the deck of 51. The first card in P(B) can be any card. For any card, there are two remaining cards that are suited connectors. If the first card was the Ace of Spades, the second card has to be the King or 2 of Spades. P(C) can only have a 10, Jack, Queen, King or Ace for its first card and second card. There are 20 such cards in the deck and 19 remaining after the first one has been dealt.
P(A) = (52/52)*(3/51)
P(B) = (52/52)*(2/51)
P(C) = (20/52)*(19/51)

The intersection P(ABC) and P(AB) cannot occur since two cards cannot be both a pair and suited connectors. P(AC) is the set of cards that are pairs of 10, Jack, Queen, King, or Ace. There are 13 different types of cards and P(AC) makes up 5 of those types (10, 10; Jack, Jack etc). P(AC) can be expressed as the portion of A that falls into C. Likewise with P(BC) with the caveat that only 4/13 types of suited connectors of B occur in C (since 10, 9 and Ace, 2 do not occur in C).
P(AC) = P(A)*(5/13)
P(BC) = P(B)*(4/13)

Plugging those into the formula:
P(A U B U C) = 20.6%
Thus a player that plays these types of hands will play roughly one of every five hands. To keep opponents from getting a clear read on what type of hands you prefer it may be advisable to play a junk hand occasionally.

I like playing suited connectors and pairs because if the next five cards improve your hand, a clear advantage can emerge. For example, if you play a suited connector and three of the next five cards are the same suit you get a flush. Unless there is a pair among those five cards, a flush will very likely be the best hand. But given that you played a pair or suited connector, what are the odds that the next five cards will improve your hand? I will attempt this question in the next post.

Sunday, July 6, 2008

The Gauntlet Revisited

An earlier post described how a player in the TV show The Gauntlet III could calculate his odds of winning a Gauntlet and who he should select as an opponent. This post will explore team strategy, in particular why the men of the Veteran team decided to purposely lose team challenges.

If a team loses a challenge, two of its members have a duel in the Gauntlet. The losing player has to leave the show. After an unknown number of Gauntlets, the show has one final challenge in which the two teams compete for $300,000. The winning team divides the $300,000 equally between the remaining members. Going into the team challenges, the participants know whether it is a "guys'" or "girls'" day. On guys' days two men from the losing team duel in the Gauntlet. On girls' days two women compete. On guys' days the women face no punishment (i.e. the Gauntlet) for losing, and the men face no punishment for losing on girls' days. To entice the opposite sex to compet on their respective days, the show offers a prize to the winning team. On girls' days, men of the winning team each get a prize of roughly $500. However, if a team loses then one of its members will leave the show, meaning a larger portion of the $300,000 grand prize will go to those who remain.

First let's take a look at how much each remaining member stands to gain when a teammate loses in the Gauntlet. The left column is the number of people remaining on the team, the middle column is how much each member will receive if the team wins the final challenge, and the right column is how much more a player gets when a teammate leaves the show.

Teams start with 16 people and every time someone leaves, the remaining members can potentially win more prize money. The 'Difference' column shows that the more people leave, the more the rest stand to gain. When the first person leaves, everyone stands to win $1,250 more. When the 10th person leaves, the team members can win over $7,000 more. For example, in the final challenge the Veteran team stood to win roughly $30,000 each and the smaller Rookie team $60,000.

Let's take a look at the normal form representation of a single stage of this game. Let us assume that it is a girls' day and we are looking at the representation from the men's view. Assume that the men think they have a 50% possibility of winning the final challenge, thus they stand to gain $625 if they lose the challenge and a teammate (1250*.5 = 625). The men from both teams have the same strategy set: Try or Shirk. A team that chooses to Try will win 100% of the time against a Shirking team. Or perhaps more accurately, the Shirking team can make sure they lose with 100% certainty. If both teams Try they each have a 50% chance of winning, if both teams Shirk they each have a 50% chance of winning.



Thus Shirk dominates Try, since the chance of $1250 ($625) is greater than the $500 prize for winning the challenge. In the next stage game, the team that lost a member has a chance to win even more than $625, since the figures in the Difference column grow as more people leave the show. Using the binomial theorem one can calculate how much present value one gains by having the chance to lose more teammates. In the first stage matrix, the $625 jumps to over $3,000 in present value. The question is not why the Veteran men decided to Shirk challenges, but why didn't they start Shirking earlier?

The payoff matrix shows that the $500 prize is no deterrent. Are there other deterrents to Shirking? The final challenge determines the grand prize. If teams with more members had an advantage in that challenge, then that would be a deterrent to Shirking. However the format of the final challenge, common knowledge to the players because of previous versions of the show, does not favor large teams. It favors teams that do not have weak links and ones with strong athletes. Many Veteran men purposely Shirked because they thought it would improve their chances of winning the final challenge. The women realized that their probability of winning the final challenge would decrease if they lost strong athletes and were less likely to Shirk. A third deterrent might be an emotional reason. Perhaps pride, a competitive nature or a connection to members of the opposite sex motivated players not to Shirk. That might explain some of the romantic relationships.

The only tool the women have to deter Shirking is threat of reciprocal punishment. "If you Shirk and send one of us to the Gauntlet, we will Shirk and send one of you to the Gauntlet tomorrow." This strategy is undermined since losing too many athletic members hurts everyone on the team and because the remaining women also benefit from losing weaker members. By Shirking and losing strong men, the women hurt themselves. By losing the remaining women, they stand to make more money, and have a better chance of winning the final challenge. The Veteran men chose to Shirk, and the women had little recourse.

If both teams' men had realized the dominance of Shirk, there would have been some interesting repercussions. Both teams' men would be trying to lose on girls' days. To try to deter this, both teams' women might play the 'Mad President' strategy (act irrational-not a stretch for this group) and try to Shirk, the final challenge be damned. The Nash Equilibrium would probably involve an agreement between the men and women on each team with both sides agreeing that a certain amount of Shirking, to lose the weaker male and female competitors, is ideal and to only Shirk strategically in order to maximize the probability of winning the final challenge.

Friday, June 20, 2008

When to Foul the Shooter

The conventional basketball wisdom is to foul the shooter rather than give up an easy lay-up. If a shooter has an easy shot, say a shot he makes 95% of the time, it is better to foul him and let him attempt two free throws rather than take the easy shot. As long as he does not make over 95% of his free throws (which almost nobody does), the defensive team will allow less expected points. If the offensive player only makes 50% of his free throws, fouling him saves .9 expected points. 2*.95 - (1*.5+1*.5) = .9 . Fouling the league average shooter, who makes 75.2% of his free throws saves about .4 points. Fouling has another detriment that is not accounted for in that math. Once a team has commited five fouls, the other team goes to the free thow line for every subsequent defensive or loose ball foul, regardless of whether the player was in the act of shooting.

During the 2006-2007 NBA season, teams scored about 1.1 points per possession and made 75.5% of free throws. If the offensive team is in the bonus, a non-shooting foul results in the defense allowing .43 more expected points than they do on an average possession. 2*.752 - 1.1 = .43. It is better to let the possession elapse without commiting a non-shooting foul. The defensive team would rather not be in the bonus. Should you still foul the shooter on an easy shot?

Before estimating the additional penalty that committing a foul detracts, here are some statistics:


Free throw % and the other stats needed to calculate Points Per Possession and Mean Fouls were found here. Points Per Possession was found by taking the league average Points Per Game, and dividing by league average 'Pace' statistic. PPG/Pace = PPP. I calculated Mean Fouls by taking the league average minutes per season, divided by 5 to make the stat minutes per team, and divided it by the league average fouls per team to get team fouls per minute. I multiplied it by 12 (minutes in a quarter) to get fouls per quarter. (Minutes/5)/(Fouls per Team) * 12 = FPQ.

I will take an extreme case to see if there is an instance where it would be better to let the offensive player have any easy shot, rather than foul. Suppose that the offensive player has an easy shot at the start of the quarter. Should he be fouled? The Poisson Distrubution, can be used to show how often a team reaches a certain number of fouls.

In this case λ = 5.51 (average fouls per quarter) and k = fouls in a quarter. On the first line of the table below is the random variable k, ranging from 0 to 14. The percentage below it the Poisson probability of that exact amount of fouls happening in a quarter. For example, the most likely outcome is a team commiting 5 fouls in a quarter, which happens 17.1% of the time. Below that number is 'Points Lost.' Points Lost is the amount of points the defense loses by fouling a player and letting him shoot free throws. As shown above, by fouling the defense allows .43 more points than they would if it did not foul. Multiplying it by the Poisson probability gives the points lost. For example, by fouling 5 times in a quarter, on the 5th foul the team goes to the free throw line and gets .43 more points. This happens in 17.1% of quarters. The penalty increases as the team fouls more often. Fouling 6 times a quarter send the opposing team to the free throw line on two occassions, allowing the offensive team to get .86 more points per quarter. The formula is .43*Poisson%*(k-4) = Points Lost. 4 being used because every time a team commits k > 4 fouls the opposing team goes to the free throw line k-4 times. Total Points Lost is the sum of expected Points Lost for each value of k.



To return to the extreme case, fouling at the beginning of the quarter has the effect of the offensive team needing to draw only 4 more fouls (rather than 5) in order to shoot free throws. Compared to the previous example, this increases the Total Points Lost by the defense. Committing 4 fouls results in Points Lost and the penalty for committing more fouls increases. For this case, Points Lost = .43*Poisson%*(k-3).

If the difference between Total Points Lost (Early Foul) and Total Points Lost (normal case)increases by more than .4 points, the amount of points the defense saves by fouling the league average player on an easy shot, then the defense would be better off not fouling. The table below shows the comparison:



The difference in Total Points Lost is .343 which is < .4. Although the defense's Total Points Lost increases with the early foul it does not increase enough to justify letting a player have an easy shot. Thus the conventional wisdom is reaffirmed for the league average player; foul him rather than let him have an easy shot. If Total Points Lost had been more than .4, the next step would have been to calculate a more accurate Total Points Lost by accounting for offensive fouls (which do not result in free throws) and shooting fouls (which always result in free throws). However that is not needed and the reader will never learn that 9.8% of all fouls committed during the 2006-2007 NBA season were offensive fouls.

While all I did was reaffirm the conventional wisdom, I believe the data is suggests that there may be special cases when the defense should not commit the early foul. If the offensive player makes easy shots somewhat than 95% of the time and makes free throws somewhat more than 75% of the time, it may be worth not commiting an early foul on him. NBA teams with access to more exact stats would be advised to, especially during 7 game playoff series, calculate some exact figures for specific players to see who and when not to foul.

Sunday, June 15, 2008

Bringing Math to the Gauntlet

Real World/Road Rules Challenge: The Gauntlet III is a reality show that I embarrisingly happen to enjoy. Two teams compete in random challenges. The losing team has to participate in the Gauntlet, a one-on-one duel where the winner gets to stay on the show and the loser leaves the show. The winning team selects the first player to enter the duel and the losing team chooses his opponent. Often the losing team would let the first player pick who he would face in the duel. I hope to show how a player can choose an opponent that will give him the highest probability of winning the Gauntlet.

To determine which game the players will play in the Gauntlet, a wheel with six outcomes (five different games and a spin again) is spun. Since all five games have an equal chance of being selected, Player 1 can calculate his odds by estimating his subjective probability of winning in each individual game, summing the probabilities and dividing by five (the number of games). For example, if Player 1 believes that he is evenly match with his opponent in all five games, his chances of winning are 50%, shown by the formula Pv:

Pv (Probability of Victory) = (.5 + .5 + .5 +.5 + .5)/5 = .5 = 50%

The games are varied and certain games favor certain types of players. It is unlikely that a player would estimate himself as evenly matched with his opponent in all five games. Force Field-basically tug of war with pulleys-favors body strength and weight. Ankle Breakers-reverse tug of war with a rope tieing a player to his opponents ankle-and Ram it Home-a shoving match of sorts also favor strength and body weight. Sliders is a puzzle game that does not require athletic ability. Ball Brawl-a race to grab and carry a ball across a goal line-gives the advantage to the faster player. Let's do another example. This time Player 1 can select a weaker, smaller Player 2, who is faster and smarter (one would assume giving Player 2 an advantage in the puzzle game) than Player 1. Player 1 calculates the games in his favor of giving him a 70% chance of winning and only 30% for the games that favor Player 2.

Pv = (.7 + .7 + .7 +.3 + .3)/5 = .54 = 54%

Another wrinkle. Ball Brawl is a repeated stage game. The winner is the first who scores 4 points. Repeated stage games, compared to a single elimination games, favor the team with a higher probability of winning. Much like the 7 game series of the NBA playoffs favor the better team more than the NCAA college basketball tournament does. If Player 1 believes that his chances of scoring in each stage game of Ball Brawl is 30%, his overall odds of winning the game drop to roughly 18%. The logic being it is easier for Player 1 to convert one 30% chance than it is to convert multiple 30% chances. The actual math can be calculated using the binomial theorem:

The winning player needs to score 4 points. There are five stage games in which to score points. In the first three stages, grabbing a ball and returning it over the goal line is worth 1 point. In the last two stages, a successful score is worth two points. The winning player needs to score 2 or 3 points in the first three stages and 2 points in the final two stages or to score 4 points in the final two stages. Say the probability of scoring in a stage game is .3. The function b(x) can be created to calculate the chance of winning ball brawl. b(.3) =


= .181 = 18% =

Or in Excel:

=BINOMDIST(2,2,.3,FALSE)+BINOMDIST(1,2,.3,FALSE)*(BINOMDIST(3,3,.3,FALSE)+BINOMDIST(2,3,.3,FALSE))

BINOMDIST(s, n, p, false) where s = number of successes, n = number of trials, p = probability of success for a trial, false = not cumulative

Formally, Pv = (p1 + p2 + p3 + p4 + b(p5)) / 5

where p1 = estimated probability of winning game 1, p2 = game 2, ..., p5 = prob of winning a stage in ball brawl

So what should Player 1 look for in an opponent? Since three games emphasize strength and body weight, Player 1's first criteria is to choose a weaker opponent. After that, the repeated stages of Ball Brawl, and the advantage it gives to the faster player, dictate choosing a slower opponent. The last criteria to evaluate is your potential opponent's intelligence. Big players will pick on small players and small players will choose weaker, slower, and or less intelligent small players.

More formally, the dominant strategy is to pick a person i ∈ S (set of of all players) for Player 2 such that Pv(i) ≥ Pv(j) for all players j ∈ S.

While I would be surprised if anybody on the Gauntlet reasoned his or her opponent selection out to this degree, it does explain why a player like Eric survived to the end of the competition. Eric was not suited for the final competition, but his sizable body weight and strength advantage made him an opponent no one wanted to face in the Gauntlet.