Posts filed under ‘Recreational Math’

What Does Pythagoras Have Against the Sox?

It’s been a tough month in Red Sox Nation. Thanks to a 5-14 record this month, the Sox have dropped from a sure playoff appearance to clinging to a 1 game lead in the loss column. They have scores 113 runs in those 19 games and given up 123. According to the Pythagorean record calculation:

\frac {(Runs Scored)^2} {(Runs Scored)^2+(Runs Allowed)^2}

the Red Sox should have won 45.8% of those games, or 8.7 out of 19.

\frac {(113)^2} {(113)^2+(123)^2}=0.458

19(0.458)=8.7

I know that if the Sox had won 4 more of these games I’d be much more relaxed about our chances. C’mon Pythagoras – you owe us!

Why are the Sox underperforming their Pythagorean record? Check out the standard deviation in Runs Scored & Runs Allowed. For Runs Scored it’s 5.7 runs, while for Runs Allowed it’s only 3.1 runs. A little more consistency in offensive production is what we need.

– George

I am a math instructor at College of the Sequoias in Visalia, CA. If there’s a particular topic you’d like me to address, or if you have a question or a comment, please let me know. You can reach me through the contact page on my website – http://georgewoodbury.com.

Advertisements

September 20, 2011 at 2:00 pm Leave a comment

Recreational Math – How To Measure A Batter’s Performance

As I’ve mentioned before, I’m a pretty big baseball fan. In my youth the accepted measure for evaluation hitters was batting average. Today there are multiple measures to evaluate a hitter’s performance. I will compare and contrast three of these measures: batting average (BA), on base percentage (OBP), on base plus slugging (OPS).

The Standard – Batting Average

A players batting average is calculated as the number of hits divided by the number of at bats.  An “at bat (AB)” is a place appearance that does not include walks, hit by pitch, or sacrifice fly. It simply measures how effective a hitter is at getting a hit.

A Better Measure – On Base Percentage

On base percentage measures the percentage of time a player reaches base, including plate appearances that result in walks and hit batters. Here’s the official MLB formula:

OBP = (H + BB + HBP) / (AB + BB + HBP + SF)

To many teams this is a more efficient measure as it values getting on base, and an increase in base runners can produce an increase in runs scored. Players with plate discipline not only reach base by seeking to draw a walk, they tire out the opposing pitcher by causing the pitcher to throw more pitches.

At one time OBP was a undervalued attribute, one that Billy Beane of the Oakland A’s was able to use to assemble a highly competitive team on a meager budget. (I recommend reading Michael Lewis’s Moneyball for a complete understanding of Beane’s strategy.)

Even Better – On Base Plus Slugging

On base plus slugging, or OPS, adds a player’s on base percentage to his slugging percentage. It is a great way to measure a player’s proficiency for reaching base (more times on base = more runs scored) and power (more power = more runs drive in).

An Example – Barry Bonds

OK, I know that my choice of Bonds is questionable, but using OPS rather than batting average really demonstrates how outstanding Barry Bonds was. (I have nothing to add to the performance enhancing discussion.)

In 2001, Barry Bonds had 156 hits in 476 at bats, which resulted in a batting average of .328, which is good but not legendary.

In the same year he reached base 342 times when you add in his 177 (!) walks and the 9 times he was hit by a pitch. That was an on base percentage of 342/664 or .515. Bonds reached base more than half of the time. (In 2004 his OBP was .609, more than 3 out of 5 times he reached base.)

Finally, his OBP was .515 + .863 or 1.379 (rounding).  His best OPS (actually anybody’s best OPS) was 1.422 in 2004, when he was 39.

Conclusion

I’m not sure that we’ll see OPS on the back of any baseball card, but if you want to build a competitive team or dominate your fantasy league, be sure to check this stat out.

-George

I am a mathematics instructor at College of the Sequoias in Visalia, CA. Each Friday my blog contains an article on recreational mathematics. Let me know if there are other topics you’d like me to address. You can reach me hrough the contact page on my website – http://georgewoodbury.com.

March 19, 2010 at 9:25 am Leave a comment

Recreational Math – How Much To Bet In Texas Hold ‘Em

In this post I will show how a little probability and a little elementary algebra can be used to determine how large of a bet you should make while playing No Limit Texas Hold ‘Em. (For a quick explanation of the rules, check out this video by Phil Gordon.)

Set Up

You have a high pair, let’s say it is a pair of Aces (A♣, A♦). There are 400 chips in the pot, and you and only one other player remain in the hand.

The flop hits the table containing no Aces, but it does contain two hearts: 10♥, 6♦, 2♥. You know there is a decent chance that your opponent holds two hearts in his hand, because he likes to play suited cards.

The question is – How much should you bet? Paraphrasing the “Fundamental Theorem of Poker”, you should bet enough so that your opponent is making a mistake if he calls.

What Are The Odds Against Your Opponent Completing Their Flush?

From your opponent’s point of view, he has seen 5 cards and 4 of them are hearts. That means that there are still 9 hearts in the deck that would complete the flush, and the other 38 would not. So the odds against the flush are 38:9, or approximately 4.2:1.

How Much Should You Bet?

If the opponent is being offered less than 4.2 to 1 on his wager, he is making a mistake to call. The goal is to make a bet (x) large enough so the ratio of the pot (400 + x) to the amount he would have to add (x) is less than 4.2. Here comes the algebra. We will determine the value of x for which (400 + x)/x = 4.2, this will give us the mathematically fair wager.

(400 + x)/x = 4.2

400 + x = 4.2x      (Note that x cannot equal 0 in this problem.)

400 = 3.2x

x = 400/3.2 = 125

A bet of $125 creates a pot of $525, offering your opponent 525:125 (or 4.2:1) odds for calling.

Any wager greater than $125, will offer your opponents insufficient odds to call. For example, a bet of $200 increases the pot to $600 and offers your opponent only 3:1 odds.

The trick is to size your bet as large as you can while still getting your opponent to call.

And If There Is No Heart On The Flop …?

You get another chance to force a bad bet. Suppose you bet $200 and your opponent called, the pot is now $800. The odds against completing the flush on the next card are now 37:9 or approximately 4.1:1. The same strategy still applies. In general, with a pot size of P, the bet size x should satisfy the following inequality:

(P + x)/x < 37/9

We find that if x > 9 P / 28, that our opponent will make a mistake to call the bet. If the pot is $800, this equates to a bet larger than$257.14. Again, the important idea is to make as large of a bet as you can that you feel will still be called.

“May all your cards be live and your pots be monsters!”

-George

I am a mathematics instructor at College of the Sequoias in Visalia, CA. Each Friday my blog contains an article on recreational mathematics. Let me know if there are other topics you’d like me to address. You can reach me hrough the contact page on my website – http://georgewoodbury.com.

February 26, 2010 at 11:25 am 2 comments

Recreational Math – Pythagoras and Baseball?

Since Spring Training began this week, I thought I would put together another baseball related article. The reference to Pythagoras has nothing to do with right triangles (How far is it directly from home plate to second base?), but instead a formula for predicting winning percentages based on a formula that has a resemblance in places to the Pythagorean theorem.

Pythagorean Record

Pythagorean Record was created by Bill James as a way to predict winning percentage based on Runs Scores (RS) and Runs Allowed (RA). Here it is:

RS2 / (RS2 + RA2)

The resemblance of the denominator to the Pythagorean theorem led to its name.

2009 Season

Here are the actual and predicted wins for the 30 major league teams last season.

Team RS RA Actual Wins Pythagorean Wins Difference
Arizona 720 782 70 74 -4
Atlanta 735 641 86 92 -6
Baltimore 741 876 64 68 -4
Chicago 724 732 79 80 -1
Chicago 707 672 83 85 -2
Cincinnati 673 723 78 75 3
Cleveland 773 865 65 72 -7
Detroit 743 745 86 81 5
Florida 772 766 87 82 5
Houston 643 770 74 67 7
Kansas City 686 842 65 65 0
Milwaukee 785 818 80 78 2
New York 671 757 70 71 -1
Oakland 759 761 75 81 -6
Pittsburgh 636 768 62 66 -4
San Diego 638 769 75 66 9
San Francisco 657 611 88 87 1
Seattle 640 692 85 75 10
Tampa Bay 803 754 84 86 -2
Texas 784 740 87 86 1
Toronto 798 771 75 84 -9
Washington 710 874 59 64 -5
Boston 872 736 95 95 0
Colorado 804 715 92 90 2
Los Angeles 883 761 97 93 4
Los Angeles 780 611 95 100 -5
Minnesota 817 765 87 86 1
New York 915 753 103 97 6
Philadelphia 820 709 93 93 0
St. Louis 730 640 91 92 -1

There were a few teams whose differences stand out: Toronto underachieved by 9 games & Cleveland by 7. Three teams outperformed their Pythagorean Record by at least 7 games: Houston (+7), San Diego (+9), & Seattle (+10).

The correlation coefficient between Actual Wins & Pythagorean Record was 0.91.

A Red Sox Example

Would the Red Sox be better served by trying to increase offensive output by 10% or by trying to improve defensive efficiency by 10%?

If they increased RS by 10% last season, they would have scored 959 runs, and their Pythagorean Record would have been 102 wins. That’s an improvement of 7 wins.

If they decreased RA by 10% last season, they would have allowed 662 runs, and their Pythagorean Record would have been 103 wins. That’s an improvement of 8 wins.

Considering that defense & pitching was easier to acquire this off season, it seems clear that trying to improve RA was the way to go. Note that if both totals decreased by 10%, the Pythagorean Record would remain at 95 wins, so it is imperative that while the defense improves, the offense stays close to previous output. Time will tell.

-George

I am a mathematics instructor at College of the Sequoias in Visalia, CA. Each Friday my blog contains an article on recreational mathematics. Let me know if there are other topics you’d like me to address. You can reach me hrough the contact page on my website – http://georgewoodbury.com.

February 19, 2010 at 10:29 am 2 comments

Recreational Math – Baseball (Top of 9th, Man on 1st, 0 Out)

Baseball was the game of my youth. I spent countless summer days playing wiffle ball from dusk until dawn, taking a short break for a sandwich, the ice cream man, and the Del’s frozen lemonade truck. (I can still taste the Del’s! in my mind!) Growing up in Rhode Island, I was also a die hard Red Sox fan. When I woke up, I read the sports section recap while I ate and closed my day listening to the game on the radio.

Baseball is also the game of my adulthood, but for different reasons. First, the Red Sox have managed to win a pair of World Series titles. Winning is good. Second, there are so many applications of math, probability, and statistics in baseball. Some credit the use of sabermetrics with helping the Sox to win, both by the front office (building the team) and the manager (making game decisions based on data and probabilities).

No Outs, Top of the Ninth, Man on First – What To Do?

In today’s article I examine an issue of contention between baseball purists and sabermetricians, tying it to probability that can be used in an Intro Stats course. Here’s the situation – the game is tied heading to the top of the 9th inning. The visiting team manages to get its leadoff hitter on first base. Should he try to steal second base? Should the next hitter try a sacrifice bunt to advance the runner to “scoring position” at second base? Let’s analyze the options.

Win Expectancy

I am basing my analysis on “Win Expectancy”. Win Expectancy is the probability of a team winning a game based on that game’s “state” – inning, outs, baserunners. The website I am using (http://winexp.walkoffbalk.com/expectancy/search) to calculate these probabilities coded games from 1997 through 2006, counts how many games were in that state, and the percentage of times that the home team went on to win the game.

As the inning starts, the visiting team has a 47.8% chance of winning the game. (If the visiting team fails to score, that chance drops to 34.4%.) If the first batter reaches 1st base safely, the win expectancy rises by nearly 9% to 56.7%.

Should the Runner Try to Steal 2nd Base?

If the runner successfully steals 2nd base, the chances for victory jump to 65.7%. If he is caught stealing, the chances for victory drop to 42.0%. Should he steal? It depends on his chances of success.

Let “p” represent the probability of stealing 2nd base and 1 – p represent the probability of getting thrown out. The expected value for the Win Expectancy can be expressed as follows.

0.657 p + 0.420 (1 – p)

This simplifies to 0.237 p + 0.420. Stealing makes sense if the expected value of Win Expectancy increases from its original state of 56.7%.

0.237 p + 0.420 > 0.567

p > 0.620

Win Expectancy increases if the player has a greater than 62% chance of successfully stealing 2nd base. For what it’s worth, the total success rate in 2008 was 73%, but you have to consider that most often stolen bases are attempted by the top base runners and not your average runner. (A look at run expectancy suggests that the percentage needs to be above 75% to be beneficial in general. Perhaps I’ll address that in the future.)

Should the Next Batter Try to Sacrifice the Runner to 2nd Base?

There are 3 likely outcomes when a batter attempts a sacrifice bunt: runner safe/batter out (61.7% of the time during the 2003 season), runner out/batter safe (23.5%), and runner safe/batter safe (14.8%).

Here are the Win Expectancy values for these situations: runner safe/batter out (55.6%), runner out/batter safe (48.3%), and runner safe/batter safe (66.5%).

Let’s look at the expected value of Win Expectancy if the batter attempts a sacrifice bunt.

0.617 (0.556) + 0.235 (0.483) + 0.148 (0.665) = 0.555

So, the sacrifice bunt lowers the Win Expectancy from 56.7% to 55.5%, telling us that the sacrifice bunt hurts your chances of winning in this scenario.

Summary

Of course, the manager’s decision depends on the runner (is he an above average base stealer?) and the man at bat (is he a skilled bunter?). If you estimate the runner’s chances of a successful steal to be above 62%, the move increases your chance for victory. The sacrifice bunt hurts your chances for victory. I guess that’s why Dave Roberts stole 2nd in the legendary 4th game of the 2004 ALCS instead of having Bill Mueller attempt the sacrifice bunt. It was just a simple matter of mathematics!

-George

I am a math instructor at College of the Sequoias in Visalia, CA. You can reach me through the contact page on my website – http://georgewoodbury.com.

February 12, 2010 at 8:44 am Leave a comment

Roulette – A Nearly Perfect Game (Friday 11/13/09)

Sorry for the delay … Internet issues at the hotel …

Since I am in Las Vegas at AMATYC 2009, I thought I’d take a look at the probabilities & expected values associated with roulette. Roulette is a game that features a spinning wheel with 38 numbered spaces (0, 00, 1-36). 18 of the numbers are red, 18 are black, and 0 & 00 are green. The dealer spins a small ball on the outside of the wheel, and the slot where the ball lands determines the winning number.

Single Number Bet

If you correctly predict the number that the ball lands in, you are paid 35 to 1. The expected value for this bet can be calculated by multiplying the probability of winning (1/38) by the return for winning (+$35), multiplying the probability of losing (37/38) by the return for losing (-$1), and totaling these products.

EV = (1/38)(+35) + (37/38)(-1) = -2/38 = -$0.053.

This expected value tells us that you can expect to lose $0.053 for every $1 you bet in this fashion.

Two Adjacent Numbers

The payout when you bet two adjacent numbers on the table is 17 to 1. The probability of winning is now 2/38 and the probability of losing is 36/38.

EV = (2/38)(+17) + (36/38)(-1) = -2/38 = -$0.053.

So, another bet with the same exact expected value.

Other Bets

Other bets you can make are:

  • Green Bet – 2 green numbers 0 & 00
  • Street Bet – 3 numbers in a horizontal row
  • Corner Bet – 4 numbers forming a block
  • Six Line – 2 adjacent horizontal rows
  • Column Bet – 12 numbers in a vertical column
  • Dozen Bet – 1st 12 numbers (1-12), 2nd 12 numbers (13-24), last 12 numbers (25-36)
  • Odd or Even Bet – Number is odd (or even)
  • Red or Black Bet – Number is red (or black)

The expected values for these bets are calculated in the same fashion.

Bet Payout P(Win) EV
Green 17 to 1 2/38 -$0.053
Street 11 to 1 3/38 -$0.053
Corner 8 to 1 4/38 -$0.053
Six Line 5 to 1 6/38 -$0.053
Column, Dozen 2 to 1 12/38 -$0.053
Odd, Even, Black, Red 1 to 1 18/38 -$0.053

Notice that all of the expected values are the same, making roulette a perfect game. Almost.

Top Line

The Top Line bet is a 5 number bet: 0, 00, 1, 2, & 3. The payout for this bet is 6 to 1. Here is the expected value for this bet.

EV = (5/38)(+6) + (33/38)(-1) = -3/38 = -$0.079.

This bet has a lower expected value than all of the others, and should be avoided.

Challenge

What payout for the Top Line bet would make roulette a perfect game? Leave a comment with your answer.

So – is there a good roulette strategy?

Not really. If you play roulette you can expect to lose roughly 1 nickel for every dollar you bet. It’s not a game you play to get rich, you have to decide whether all of those nickels you are about to lose is worth the entertainment value of the game. And stay away from the top line!

I am a math instructor at College of the Sequoias in Visalia, CA. If there are topics you’d like me to address in future Recreational math articles, send in your requests through the contact page on my web site. – George

November 14, 2009 at 10:39 am 2 comments

Recreational Math – Canadian Blackjack (Friday 11/5/09)

Note – This is the first in a series of Recreational articles that will appear each Friday. Some typical topics include sports, music, poker, cooking, …

Several years ago I was in Toronto, Canada and went to a temporary casino that had been set up at a national exhibition. I sat down at a blackjack table and realized that although the rules were the same, the game was quite different. The dealer dealt 1 card face up to each player as well as 1 face up to himself. Then a second card was given face up to each player, but the dealer did not take a second card, instead waiting for all play to finish before taking his second card.

I was sitting at third base, which is the last spot before the dealer. On one hand I had 16 while the dealer had a 10. Basic blackjack strategy states that I am supposed to hit that hand, because if I stand I will only win 21.2% of the hands since that is the probability that a dealer showing a 10 card busts. If I hit, 8/13 of the time I will bust, but the other 5/13 of the time I will make a hand between 17 & 21.

As I sat with my 16 it dawned on me that of the 5 cards that could possibly help me, 4 of those cards gave the dealer a hand of 12-15 which he could then bust from. I decided to hit but announced that I was unsure whether it was the right move, much to the chagrin of my new Canadian friends. I tried to explain my reasoning, but lacked the tools (pencil, paper, calculator, StatCrunch, …) to do an analysis of the situation.

Here goes …

Should a third baseman with a hand of 16 stand against the dealer’s 10 in Canadian Blackjack?

Preliminaries

There are some probabilities that I will need, and will display them here. I will spare you the derivation, but can share if you are interested.

Probabilities for possible outcomes when the dealer starts with a hand of 10

Outcome 17 18 19 20 21 Bust
Probability 11.2% 11.2% 11.2% 11.2% 34.0% 21.2%

Probabilities that a dealer busts with hands from 12 to 16

Hand 12 13 14 15 16
Probability Bust 48.3% 52.0% 55.4% 58.6% 61.5%
Probability 17-21 51.7% 48.0% 44.6% 41.4% 38.5%

Some Bad News

The bad news is that 7/13 of the time, it does not matter if you stand or hit. You’re damned if you do and damned if you don’t. Any of the cards (7, 8, 9, 10, J, Q, K) will bust you if you hit, and will give the dealer a made hand if you stand. One point that I want to make clear – if you stand on 16 the only way you can win is if the dealer busts.

The Other 6/13 of the Time

Let’s consider the individual cases in which the next card is an A-6.

Next Card is an Ace

If the next card is an Ace and you stand, the dealer has blackjack. You lose, and so do all the others sitting at the table. You won’t make many friends, but you might get to find out if that Canadian health care system is all it’s cracked up to be.

If you hit you will have 17. You will win if the dealer busts (21.2%), push with the dealer 11.2% of the time, and lose 66.6% of the time.

Next Card is a 2

If the next card is a 2 and you stand, the dealer has 12. You will win if the dealer busts (48.3%), and lose 51.7% of the time when the dealer makes his hand.

If you hit you will have 18. You will win if the dealer busts or makes 17 (32.4%), push with the dealer 11.2% of the time, and lose 55.4% of the time.

Next Card is a 3

If the next card is a 3 and you stand, the dealer has 13. You will win if the dealer busts (52.0%), and lose 48.0% of the time when the dealer makes his hand.

If you hit you will have 19. You will win if the dealer busts or makes 17-18 (43.6%), push with the dealer 11.2% of the time, and lose 44.2% of the time.

Next Card is a 4

If the next card is a 4 and you stand, the dealer has 14. You will win if the dealer busts (55.4%), and lose 44.6% of the time when the dealer makes his hand.

If you hit you will have 20. You will win if the dealer busts or makes 17-19 (54.8%), push with the dealer 34.0% of the time, and lose 11.2% of the time.

Next Card is a 5

If the next card is a 5 and you stand, the dealer has 15. You will win if the dealer busts (58.6%), and lose 41.4% of the time when the dealer makes his hand.

If you hit you will have 21. You will win if the dealer busts or makes 17-20 (88.8%), and push with the dealer 11.2% of the time.

Next Card is a 6

If the next card is a 6 and you hit, you lose. Period. You have 22 and it will not matter what happens to the dealer.

If you stand, the dealer has 16. You will win if the dealer busts (61.5%), and lose 38.5% of the time when the dealer makes his hand.

So, where does that leave us?

Here is a table showing the probabilities of winning and losing for each “next card” and expected value (EV) for standing and hitting. (The expected value is obtained by multiplying the probability of winning by +1, multiplying the probability of losing by -1, and summing these values.)

Stand Hit
Card Win Lose EV Win Lose Push EV
A 0 1 -1 .212 .666 .112 -.454
2 .483 .517 -.034 .324 .564 .112 -.240
3 .520 .480 .040 .436 .452 .112 -.016
4 .554 .446 .108 .548 .112 .340 .436
5 .586 .414 .172 .888 0 .112 .888
6 .615 .385 .230 0 1 0 -1
7 0 1 -1 0 1 0 -1
8 0 1 -1 0 1 0 -1
9 0 1 -1 0 1 0 -1
10 0 1 -1 0 1 0 -1
J 0 1 -1 0 1 0 -1
Q 0 1 -1 0 1 0 -1
K 0 1 -1 0 1 0 -1
Total -7.484 -6.386

The expected value for standing is -7.484 over 13 hands. The expected value for hitting is -6.386 over 13 hands. You lose less per hand by hitting than by standing, so hitting 16 versus the dealer’s 10 is the right play.

Now for what may be a surprising result – the expected value for standing in Las Vegas blackjack in the same situation (16 versus dealer’s 10) is

EV = 13 [ (.212)(+1) + (.788)(-1) ] = -7.488

This is only off by 0.004 from my Canadian expected value, and this is due to the rounding of probabilities to 3 decimal places.

So – what do I do if I have 16 versus a 10?

First – have a good cry because you are probably going to lose. Next ask the dealer for a small card and hope for the best.

I am a math instructor at College of the Sequoias in Visalia, CA. If there are topics you’d like me to address in future Recreational math articles, send in your requests through the contact page on my web site. Be sure to check out next Friday’s article – “Are students with neat handwriting better math students?”.  – George

November 6, 2009 at 5:51 am Leave a comment


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,501 other followers

December 2017
M T W T F S S
« Aug    
 123
45678910
11121314151617
18192021222324
25262728293031

Categories