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

Wednesday, February 24, 2021

Chance of Precipitation

I heard the term POP on the radio. It stands for "Probability of Precipitation". The explanation of it was pretty simple, but there is a little more to it than I thought. What it measures, of course, is the chance you are going to get rain, snow or whatever, falling on you that day. A fairly simple formula: 

POP = (probability any precipitation falls in the area) x (predicted area of coverage).

Examples: 

The meteorologist thinks about half the region will get wet. There is a 20% chance it rains somewhere in that area. So, 0.50 x 0.20 = 10% chance of rain.

There is a 70% chance of rain falling somewhere in the region. The coverage is almost total, say 90%. So, 0.70 x 0.90 = 63% chance of rain. That is, a 63% chance that it will rain on you.

By the way, that number doesn't tell you anything about how much it might rain. Although by "precipitation" they do seem to hold to there being at least a hundredth of an inch falling.  

I missed out. I think I would have liked to have been a meteorologist.

Monday, January 18, 2021

Wilt's Free Throws

 Wilt Chamberlain is the second leading scorer of all time. Right behind Michael Jordan. But, he couldn't shoot free throws. He once missed 22 straight free throws. That seems worth investigating. First what are the chances? He made 51.1% of his free-throws during his career. In other words he has a 48.9% chance of missing. So to miss two straight would be .489 x .489 = .239121 or a 23.9% chance. Twenty-two in a row? That would be .489 to the 22nd power. That comes out to 0.000000146. 

Just for fun, I took the reciprocal. That is almost seven million. He shot over eleven thousand free throws in his career. I thought missing 22 in a row might be somewhat likely. But no, it isn't. There is a lot of math here a person could play with. Wilt wasn't the worst ever. Andre Drummond makes 38.6% of his free throws. You could figure the probability for him missing 22 in a row.

Could a typical player do this? Lets suppose we want to find out, what percent would you normally have to shoot to have a 50% probability of of missing 22 in a row.  The equation would be x^22 = .50. Using the log and inverse log on your calculator, you come up with 96.9%. That is the chance you miss a shot. So, that means your free throw success rate would be 3.1%. Not good.



Monday, November 23, 2020

Virus Probabilities

 I saw something on the news about the coronavirus. Wearing a mask is 70% effective in blocking the droplets that can cause you to be sick. If you and the other person is wearing a mask, you only have a 9% of getting infected. (Those numbers are what I heard, but I'm not certain of the context because I wasn't totally paying attention, but we'll run with it.) Those numbers seem right, mathematically. You have person A and person B. You want either one's mask to block the germs.

Probablility of A or B is happening is 

Pr(A) + Pr(B) - Pr(A) x Pr(B).=  0.7  +  0.7  - 0.7 x 0.7 = 1.4 - 0.49 = 0.91. 

Thus,a 9% chance germs get through.

Looking at it another way, start directly with the probability germs get through.

C and D are now the events that germs aren't blocked.

Pr(C) x Pr(D) = 0.3 x 0.3 = 0.09

Again a 9% chance.



Pr(B) - Pr(A) x Pr(B).=  0.3 +  0.  - 0.7 x 0.7 = 1.4 - 0.49 = 0.91. 


Tuesday, October 6, 2020

Going for Two

Seems like I wrote something like this before, but things have changed now, so it is time to revisit. In the NFL, after you score a touchdown, you can go for a one-point conversion, by kicking, or go for a two-point conversion, by running or passing. The two pointers are harder to make, though. So which should you do? The kicks pretty much always went through. Because of that, the NFL decided they needed to make things a little more interesting and moved the kick back a ways. It still almost always goes through, but the percent is down a little bit - to a success rate of 93.8% of the time. The pass or throw option is roughly half - a success rate of 50.1%.

We should find the expected value for each. 

For a kick, you can get one point, 93.8% of the time:

                    1 x .938 = .938 points per try

For running or passing, you get two points, 47.9% of the time:

                    2 x .501 = 1.02 points per try

Is that even worth messing with? It depends on how good your team is, but typically a team scores something around 60 touchdowns in a season. That would mean roughly (.938 x 60 =) 56.28 points if you kick all the time. And (1.02 x 60 =) 61.2 when running or passing. So about five point over the course of a season. So not a lot, but then again, it only takes one point to lose a game.

And of course your decision could depend on the situation in any particular game. If you score a touchdown near the end of the game and you are now behind by two, you definitely would go for the two-point attempt. 

By the way, I don't know if this was in the book, but Scorecasting is a great little book about sports and how coaches don't always do what makes the most sense. 



Sunday, April 9, 2017

Sermon Stats

In sermon notes in a church bulletin it stated, "The probability Jesus could have fulfilled even eight of these prophesies is 1 in 10 to the 17th power (1 in 100,000,000,000,000,000)". This was a statistic taken from a book, although I don't know the title. I thought there is a math application in there somewhere.

I thought that small a number might be almost incomprehensible to most. Maybe to everyone. It
reminds my of something David Letterman said once regarding buying a lottery ticket. A particular lottery was at a near record amount and lots of people were buying them. He wanted people to consider that if you buy a ticket, your chance of winning is only slightly more than if you don't buy one. Incidentally, I was in the audience for one of his shows during his final month. Hilarious. I am including a picture for no other reason than I love Dave. Back to math.

I considered a couple of ways to tie this probability to other situations. How does this probability compare with chances in rolling a die? In flipping a coin?

Well, the chances of rolling a "6" are one in six. How many consecutive rolls would correspond to the above probability?

1 / 1017 = 1 / 6x
1017 = 6x
Taking the common log of each side, we get:
17 = x(log6)
x = 21.85

So, at least 21 consecutive rolls coming of 6.

Similarly with flipping the coin. The coin has only two outcomes, so:

1 / 1017 = 1/2x
After a few steps we get x = 56.47

56 heads in a row. Unlikely.

If worried about church vs state issues, a teacher could come up with other kinds of problems. The actually probablility of winning a certain lottery, winning the grand prize in the McDonald's Monopoly Game. For example, I just looked up on-line that the probability of getting the Boardwalk piece - 1 in 602,000,000.

Good Luck.

Tuesday, February 28, 2017

Weather Forecasting

Well, guess what happened? Gonzaga lost. You might remember my post from a couple weeks ago. The Gonzaga's men basketball team was undefeated with four games to go. We figured out they had a 91% chance of remaining undefeated. They won the first three, then lost the very last game of the season. So much for the 91% chance.

It was a pretty good mathematics application, I thought. If this was presented to a math class, how would the students react. My guess is that they would say the math failed. A 91% chance is not a sure thing, but there have been some studies that suggest people take it to be that. And on the other hand, people assume that a really low percentage is the same as no chance. This might lead to a good class discussion.

This made me think about other forecasts? Specifically, how do weather forecasters decide on the percent chance of rain. I found a post by a weather person at WESH TV, Amy Sweezey. Although we haven't met, and I don't even know what she looks like, she seems delightful. And smart. I learned some interesting things about how they make a percent estimation of rain for the day.

So what does a 40% chance of rain mean? It turns out that it depends.

Let's say that there is a 40% chance of rain over about half of the area in question.

Some weather forecasts will call this a 40% chance of rain. In a way it is. There is a 40% chance of rain somewhere in the area.

Some weather forecasts will call this situation a 20% chance of rain. And again in a way it is. There is a 20% chance that it will rain where you are currently standing.

As Amy says, "When it comes down to it, you cannot base your plans around a rain percentage." It's more important to know where, what time, and how heavy it will be.

It's because of this that many stations won't even do a percentage. Instead they might use descriptive words like "scattered showers", "isolated", "a few showers", and "likely".



Tuesday, February 14, 2017

Gonzaga Probabilities

A lot of games on TV will put up statistics way too fast. They're up for a few seconds and its tough to take it all in. Maybe it is the Detroit Lions' total rushing and passing yardage for each of the past three seasons. You got about five seconds to see it and try to make some sense of it. They obviously have some point they are trying to make with all those numbers, but tough to take in. Sometimes you just have to stare at things for awhile.

I did see one a few days ago that didn't have too many numbers in it. Gonzaga is currently the number one college basketball team. In fact they're undefeated. What are the chances they stay undefeated? It's 91%, they claim. They also showed the chance of winning each of their remaining games. Those chances are:

  • 98%
  • 99%
  • 98%
  • 96%
How did they come up with those numbers? I'm not sure. They didn't explain that. I tried looking on the internet to find out. That didn't work so well. Different associations (Vegas, ESPN, etc.) have their own different methods. Most of them let you in only partially on how they figure things. Turns out they take a lot of things into account. Your win-loss record, opponents win-loss record, playing home or away, point differentials, injuries, recent win-loss records, etc.

Then how they take all that data and come up with a percent is a mystery. What isn't a mystery is the 91% chance of winning all four of those games to remain undefeated. It is an "and" probability problem, which mean we can just multiply those individual probabilities together.

       (0.98)(0.99)(0.98)(0.96) = 0.9128 or just over 91%

On a related note, the University of Connecticut women's team won their hundredth game in a row last night. Pretty impressive. Impressive especially considering the following:
  • A team that usually wins 80% of its games has a (0.8)100 = 0.00000002% chance of winning 100 in a row.
  • The best NBA record ever is Golden State last year. They won 89% of their games. Thus, a 0.00087% chance of winning 100.
  • How about a team that wins 99% of its games? They have a 36.6% chance of winning a hundred in a row.
Here is a little higher mathematical problem. What kind of team would it take to have a 50% chance of going on a 100 game winning streak?

  • x100 = 0.5 
  • 100(log(x)) = log(0.5)
  • x = 0.9931
So you need to usually have a 99.31% chance of winning any single game you would play to have a 50-50 shot at winning 100 in a row.

In your mind this is maybe not the most important math application ever, but many students are into this kind of thing. And it does beat flipping coins and pulling various colored socks from drawers.


Tuesday, October 18, 2016

No hitters

Sorry, but I can't help but go back to baseball stats for the next couple weeks. It is playoff time for baseball, so I can't really help it.

Clayton Kershaw had a no hitter going for a while a couple days ago. No hitters are pretty rare. I got to thinking that you could maybe estimate the chances of a no hitter. Let's say a team would normally bat 0.250 against you. That is, they would get a hit every four times at bat. What are your chances of a no-hitter? You need to retire 27 batters (3 in each of the 9 innings). The probability you retire the first batter is .75. The probability of retiring the second batter is 0.75 x 0.75. The probability of having a no hitter in just the first inning is 0.75 x 0.75 x 0.75 or 42.2%.

For the whole game, the probability of a no-hitter would be (0.75)^27 = 0.000423. Unlikely.

You can give up walks or have batters reach on errors and still have it count as a no-hitter. I don't think we need to take that into account, though, as they do not count as official at-bats anyway. I had to think about that a bit, but I'm pretty sure I'm right on that.

Then I thought about estimating how many there should be in a season or any given period of time. I went back to 1998 because that is the last year major league baseball added teams. Since then, to the present day, there have been 30 major league baseball teams. With 162 games for each team, from 1998 to 2016 (19 years) there have been 162 x 30 x 19 = 92,340 save opportunities. If we use the above probability, the number of no-hitters during that time would be: 92,340 x 0.000423 = 39.1 saves.

How many have there actually been? 49. Keep that number in mind. We'll compare other outcomes to that.

So, not bad. In fact, a lot closer than I thought it would be.

The big question mark in all this, I think, is the batting average. The overall major league average is a little higher than this, maybe 0.260. Doing the math again would give an estimate of 27.2 (lower than the aforementioned 39.1).

But maybe we shouldn't be talking about the league average. You would figure the type to get a no-hitter is a better than average pitcher. And in fact, looking at the list of those that have thrown no-hitters shows some of the best pitchers of the past 20 years - Jake Arrieta, Max Scherzer, Cole Hamels, Clayton Kershaw, and Justin Verlander. (And there have been some pitchers that had some talent, but also a good amount of luck on their side that day of their no hitter.)

So maybe the correct batting average would be 0.240 -- 55.9 no-hitters.

Or maybe a batting average would be 0.230 -- 79.6 no--hitters.

Anyway, for those somewhat interested in the topic of baseball this was an interesting math application on baseball and probabilities.

Tuesday, October 4, 2016

Morse Code

I saw something about Morse code and thought it might be an interesting topic as a mathematics application.

First, some background.

Samuel Morse was born in 1791. He attended Yale, graduating in 1810. He aspired to be a painter. I didn't realize he did of this other career until I read about his paintings in David McCollough's book, The Greater Journey: Americans in Paris. Here is his portrait of President James Monroe.

He lost his wife and both parents in a three year span. As an escape, he went to Europe. During this time he made some contacts that led to led to the invention of Morse Code.

It didn't catch on for a few years. A U.S. congressman showed interest and a test was done with a wire stretching from Washington D.C. to Baltimore. He successfully asked, "What hath God wrought" and the rest is history.

It relies on a series of dots and dashes. They can be communicated with electronic impulses or light impulses. It was very important, but began to fall out of favor with the invention of Bell's telephone in which actual words could be used instead of a code for spelling out words. It is still used in various areas, including signal lamps by the coast guard. Those without speech can use the tapping of Morse code to communicate. But for the most part, it is found in history books.

SOS, for example, is ...---... How many are combinations of dots and dashes are needed to cover the alphabet? This could be found use the fundamental counting principal (If there are "m" ways to do one thing, and "n" ways to do another, there are "m x n" ways to do both.)

  • Using one symbol means a dot or a dash could be used - two choices.
  • Two symbols means there are 2 x 2 = 4 ways.
  • Three symbols means there are 2 x 2 x 2 = 8 ways.
  • Four symbols means there are 2 x 2 x 2 x 2 = 16 ways.

Since there are 26 letters in our alphabet, this still isn't enough. We could use five symbols, but that makes it more cumbersome. I can be done, though, by using one, two, three, or four symbols. Since 2+4+8+16 = 30. That is plenty to cover the whole alphabet.

If we need more that just words - digits, or symbols like ? and ;, we are going to need more. So for them, we need to use 5 symbols. How many possibilities would that give us?

Two to the fifth power is 32, and that means we have 2+4+8+16+32 = 62 possibilities. That gives us enough for 26 letters, 10 digits, and 26 more symbols beside.

Monday, July 11, 2016

Wedding Pictures

I was at a wedding this weekend. Counting parents, bridesmaids, etc. there were about 15 people during a photography session right before the ceremony. It seemed to go on and on with various combinations. I of course thought, "I wonder how many combinations there are if we do all the possibilities."

After a little thought, I figured it would be:

C(15,0) + C(15,1) + C(15,2) + C(15,3) + ... + C(15,15)

Granted, some of these would be unlikely, e.g., C(15,0), but this expression would at least figure the upper bound. Then I was told that the total could be found with 2 to the 15th power. I never knew that. If true, that is cool. I don't know if that is true, because I have not worked out the proof. I assume I would not be smart enough to do so.

I did try out a few cases to see if it worked for them.

c(2,0) + c(2,1) + c(2,2) = 1 + 2 + 1 = 4. This is equal to 2^2.

Also c(3,0) + c(3,1) + c(3,2) + c(3,3) = 1 + 3 + 3 + 1 = 8. This also happens to be 2^3.

It's looking pretty good. As I look at this, I'm seeing Pascal's Triangle. So there is another thing I wasn't previously aware of. I'm learning.

Anyway, most combinations of ways to group those 15 people was 2^15 = 32,768.


Tuesday, May 31, 2016

Warriors 3-1 Comeback

I happened to be in the bay area this weekend. The bay area the home of the Golden State Warriors. A few days ago it wasn't looking good for them. Oklahoma City was ahead three games to one in their best of seven series. So to win, Golden State would have to win three games in a row.

There were a million sports radio shows that had their predictions of the likelihood of Golden State winning three in a row. Most all of them decided that it was not likely. But somehow they did. I like to think my presence in the bay area had a little to do with those wins. What were the chances anyway? Virtually all of the radio experts were making basketball predictions. However, it is also a good math application as well.

Theoretically I would think that 0.5 x 0.5 x 0.5 = 0.125 might be it. So the team with the lead has a 87.5% chance of winning the series. Historically, counting Golden State's win, the team that was ahead has now closed it out 95.7% of the time. It's close, but quite a bit ahead of our theoretical figure. But that does make some sense. We were assuming the chance of a single win is 50%. But if your team is ahead three games to one, you probably (but not necessarily) have the better team. Maybe that team against the same opponent would win 60% of the time. Then 0.4 x 0.4 x 0.4 = 0.064. That means the leading team would have a 93.6% chance of winning the entire series. Now we're getting there.

In fact, what winning percentage would correspond with the 95.7% figure? If the chance of winning three straight is .043 (1 - .957), then the chance of winning one game is the cube root of .043 or .350. That would mean that the team ahead in the series would normally beat the other team in a single game 65% of the time. That seems fairly reasonable.

I found a bunch of cool historical stats like this on the following website: http://www.whowins.com/tables/up31.html

I'm sure there are others like this with different scenarios. This one states the chances of winning if a team is up 3-1 in the playoffs in various settings.

  • In the NBA it is now 95.7%. 
  • In major league baseball it is only 85.2% (slightly less than the theoretical percent).
  • In the NHL it is 90.1%
  • In all three sports combined it is 91.7%
This might be of a bit more interest to students before the series is over, but regardless, I think its a pretty cool application.

Tuesday, April 5, 2016

Scratch off

Here is another company promotion. A local car dealership sent out a flyer with scratch-offs. People can't resist scratch-offs, so that is a bit of a ploy in itself.

You can win:

  • $25,000        Odds        1:25,000
  • $500             Odds        1:25,000
  • $2                 Odds        24,996:25,000     OR     $25,000        Odds        1:25,000
  • $1,000          Odd          1:25,000
I know that third line looks a little funky, but that is how they had it in the ad. The connector between all of these are "or" so what is the point? I guess they're trying mess with your head again and make it look more likely that you will win something other than the $2 prize. (We'll give them a pass on the fact that these are actually probabilities and not odds.)

To the casual observer it looks like a pretty good chance of making a lot of money - either a 3 out of 4 or a 4 out of 5 chance. Of course, in actuality, the chance of getting anything good is 4 out of 25,000 = 0.016%.

So students could do a number of things to analyze this psychologically and mathematically. Another activity is to find the expected value:

0.00016 x $25,000 + 0.00016 x $500 + 0.00016 x $25,000 + 0.99984 x $2 +  0.00016 x $1,000
= $10.24

So, I guess there is no harm in trying for it. I did the scratching. It gave a code and then you had to call to see what you won. I'm sure this gives them another chance to talk you into buying a car - and to give you, undoubtedly, your $2.

My preference - If I do by a car, save the promotion and just take $10.24 off the price.

Monday, March 28, 2016

Arby's Promotion

In these bog posts, I try to come up with something that has struck my fancy in the last couple days. Regardless the fact that no one has used the phrase "struck my fancy" in a generation or two, You know what I mean.

A couple related things happened lately. Both were promotions by companies, both used probabilities correctly, but kind of sneakily, I guess hoping that people wouldn't notice. Both are good math applications for students that are just starting out in probability and can be seen in ways they are familiar with.

First one - I was in Arby's - a place I love. They had a sign trying to get customers to go on-line to fill out a customer satisfaction survey. If so,you could "RECIEVE 10 CHANCES TO WIN $1,000 DAILY". The hook is a person figures their chances of winning has gone up tenfold. It hasn't.

We don't know what are chances really are. Let's suppose they randomly chose one from eighty people that have gone on-line to take the survey. You have a one out of eighty chance of winning = 1.25%,

But wait, you have ten chances to win. So it was like you were standing in a line with seventy-nine other people. Now there are ten of you in line. But wait. There are ten of everyone else, too. Your chance of winning is not 1:80. It is 10:800. But wait. This is also 1.25%.

This technique seems to also be common in school raffles. You pay your money and they tear off three raffle tickets and hand them to you. Even if you know probability, you momentarily might think you're better off. You would be if you were the only one getting three tickets, but every entrant is getting three tickets as well. You're not getting cheated, you just aren't any better off. It's basically a marketing ploy. No harm done.

I've gone on long enough. I'll do my second example next week.


Sunday, November 1, 2015

The Law of Large Numbers and MVP's

As you do repeated trials, the mean average of those trials will approach the theoretical mean. Or if you are looking at a sample, as your sample grows, its mean average will get closer to the mean of the entire population.

The law of large numbers is a good title for this. Many have the idea that the law of probability would imply that a .250 hitter that goes 0 for 3 is now "due" for a hit. Flipping a coin 10 times means you'll get 5 heads and 5 tails. For most of us, our own life experience would show statements like these to be incorrect. It would not be weird for a coin being flipped 10 times to have 3 heads and 7 tails. However, we would think something was up if we flipped it 1,000 times and got 300 heads and 700 tails.

Like many math teachers, I would have classes do some coin flipping experiments. Always a fun day. For years I would write down the results and keep a running total. I don't know where that is now. I wish I had kept that. I was up to something like 20,000 flips. It wasn't 50-50, but pretty close. Maybe something like 49.7% to 50.3%.

I'm reminded of this in something I read in "The Signal and the Noise: Why So Many Predictions Fail - But Some Don't" by Nate Silver. It's an interesting book. One example: At what is a major league baseball player at his peak? You can make a pretty good case for it being 27 years of age. To make his case, he looked at 50 MVP award winners. Granted, 50 is possibly not to be considered a "large number", but it's what was used in this case.

"A baseball player...peaks at age twenty-seven. Of the fifty MVP winners between 1985 and 2009, 60 percent were between the ages of twenty-five and twenty-nine, and 20 percent were aged twenty-seven exactly."

This doesn't prove anything for sure, but then again, surveys never do. I would think we would have a better idea as we can look at additional MVP's in coming decades, giving more applicability to the law of large numbers. Also, the results might have been more convincing if they didn't include Barry Bonds steroid-assisted MVP awards in his late thirties.


Tuesday, August 11, 2015

Home Field Advantage

While a lot of people would say that the law of averages would say that flipping a coin means there will be five heads and five tails. Anyone who has flipped coins know this isn't necessarily true. However, things do even out in the long run. In ten flips of the coin, we would not be surprised to get seven heads and three tails. However, we would be quite surpised to flip a thousand times and get seven hundred heads and three hundred tails.

Sometimes the probablilities will sometimes change because circumstances change. We expect coins to fall 50-50 regardless what year we do the flipping. The average life span though has changed through the years.

How about home field advantage for a major league baseball team. Things have certainly changed there. A hundred years ago there were no night games, all the players were white, and spitballs were legal. Fenway Park and Wrigley Field were brand new stadiums. It wouldn't be surprising if home field advantage, if there really is such a thing, didn't change some through the years. Check out the home field winning percentage by decade. (From www.baseballprospectus.com/)

1900-1909     53.3%
1910-1919     54.0%
1920-1929     54.3%
1930-1939     55.3%
1940-1949     54.4%
1950-1959     53.9%
1960-1969     54.0%
1970-1979     53.8%
1980-1989     54.1%
1990-1999     53.5%
2000-2009     54.2%

Maybe even more striking (pun!) is to look at figures rounded to the nearest percentage.

1900-1909     53%
1910-1919     54%
1920-1929     54%
1930-1939     55%
1940-1949     54%
1950-1959     54%
1960-1969     54%
1970-1979     54%
1980-1989     54%
1990-1999     54%
2000-2009     54%

A good intro to this might be to have students share if they think if there is such a thing as home field advantage, what it might be, and would it have changed in the past century.



Monday, August 3, 2015

Coke Rewards

I've collected the codes attached to Coca Cola products for awhile now. I'm about ready to give that up for several reasons. For one, I probably don't need to give up hours recording those codes to finally have enough to get items such as a free t-shirt advertising their company. Anyway, those codes seem longer than they need to be. Here is one I recently used - 5KBMNOMN6FWPFW. There doesn't seem to be a reason for it. I figure the possible combinations are astronomical. There doesn't seem to be anything in particular that would limit the possibilities. For example, I thought maybe the first entry might always be a digit. No, sometimes a digit and sometimes a letter. They do state that the letter O (oh) and the number 0 (zero) are registered the same. This is also true entering the letter I and the number 1.

I had given this some, but not a lot of thought previously. But I read on their website's FAQ section the following:

Why did My Coke Rewards change from 12 digit codes to 14 digit codes? 
Due to the popularity of our program, we’ve made the transition from 12 digit codes to 14 digit codes, to ensure we have a steady supply of codes for you, our loyal members. Please note that 12 digit codes are ineligible effective 8/1/2014.

Really? Twelve are not enough? How many is that anyway? Without knowing of any other limiting factors I assume there are 34 possibilities for the first part of the code. (The 26 letters of the alphabet, the 10 numeric digits, and throwing out the two repeats.) So how many for the 12 digit codes?

                      34x34x34x34x34x34x34x34x34x34x34x34 = 2.386x10^18

I understand there are about 8 billion people on the Earth currently. Dividing those two numbers we see there are enough codes that each person on Earth could have 2,983,000,000 of them. Seems like enough. But apparently there was a need to go to a fourteen digit code. (Since Coke uses the term "digit" to designate both numbers and letters, I will too.)

Students can brush up on their scientific notation a little more by finding the amount of 14 digit codes.
   
                           2.386x10^18 x 34 x 34  = 2.758x10^21

I looked on-line and found that scientists have a rough estimate of grains of sand of all the beaches of the world. There very roughly, 7.5x10^18 grains of sand in the world. Hopefully 14 digits are going to be enough for the Coke folks.


   
   

Tuesday, July 14, 2015

Winning a car

I got my mail today. It turns out I might have won a car. First I have to scratch something off to see if I'm in the running. I scratched and it turns out I'm already a winner!!!! Looks like luck is on my side already!!! Now I know I've won at least something. There are only four choices. Three of them are great, and one is just a two dollar bill. So I'm thinking a three out of four chance of winning a big prize.

I checked out the fine print included in the add. It doesn't seem as good as it did a minute ago:

2015 Jeep Patriot or $25,000 - Odds of Winning - 1:25,000

$100 - Odds of Winning - 1:25,000

$2 - Odds of Winning - 24,998:25,000

So first of all, I didn't have a three out of four chance of winning something good as you had a chance to win the $25,000 or the car, but not both. So I have a two out of three chance of winning something good.

Secondly, it turns out I don't have a two out of three chance. I have a two out of 25,000 chance.

Good can come out of this, as there is much students can learn from this.

For one, it could be pointed out that despite what the ad says, these are probabilities and not odds, but why quibble?

Next, students could spot all the mind games that are being played. Getting you hooked by having you scratch off something. Feeling lucky when you are successful (which undoubtedly everyone is). Having what looks like three pretty good prizes, but is only really two.

Students can learn about expected value. The expected value could be found as $25,000 x 0.00004 + $100 x 0.00004 + $2 x 0.99992 = $3.00384

On the plus side, there is no way you can lose, but chances are you don't win very much. In most gambling, a person has to put up some money to play the game. That is the upside for the person/company/casino running the game. In those cases, the house typically sets up the game so the player's expected value is a negative number. What is the company's incentive in this case? They are obviously hoping to win their money on the back side of the game. They're hoping to get extra traffic to their showroom to sell a few more cars.

Gimmicky advertisements can be a great learning experience.






Monday, June 22, 2015

Expected Value for Robbing a Bank

"When to Rob a Bank" is a book written by Steven Levitt and Stephen Dubner. It is a collection of stories from their blog. They are two economists who previously wrote the bestselling "Freakonomics".

An article in this latest book gives some statistics on bank robbery in the United States. It's not as lucrative a business as I thought. Bank robbers get away with it 65% of the time. Chances are, the average bank robber gets away with it, but there is a pretty solid chance he doesn't. Another drawback is that they don't get nearly as much money as I thought. The average haul is only $4,120. That is quite a bit of money I suppose, but it isn't going to make you rich. You would have to rob a bank a month to get yourself to a middle class income. And a lot more than that to get rich.

When I read this, I wondered what the expected value would be? Expected value is the average value you expect to gain in an experiment with a large number of trials. In this case, you have a 65% chance of making $4,120. But how do you put a value on getting caught? You would be going to jail, I'm guessing for roughly 5 to 10 years. How much would you pay to have your freedom instead? In other words - How much would you pay for a get out of jail free card? I'm guessing conservatively that has to be worth at least $10,000 to you. 

                    Expected Value = 0.65(4,120) + 0.35(-10,000) = -$822 

We've established mathematically that crime doesn't pay.

What if we didn't just rob one bank. Let's try robbing two. Basically three things could happen.

1. You successfully rob both banks. Probability = (0.65)(0.65) = 42.25%. Payoff = $8,240.

2. You rob one and then get caught trying to rob the second. Probability = (0.65)(0.35) = 22.75%. Payoff = -$10,000. We're assuming they won't let you keep the money from the first bank and you still are going to jail for 5 to 10.

3. Probability you are caught the first time. Probability = 0.35. Payoff = -$1,000.

                    Expected Value = 0.425(8,240)+0.2275(-10,000)+0.35(-10,000) = -$2,293.60

Crime doesn't pay.