Real Mathematics – What are the chances?! #8

Hooligans

This year’s cup final will be between two arc-rivals of the country; it is both a final and a derby game. Supporters of both sides are waiting anxiously for the game. Though, Steve has no interest in this game. His team was eliminated in the semi-finals.

Two of Steve’s close friends, Jack and Patrick, have been arguing over the final for the past two weeks. Jack thinks his team FC Ravens will be the winner as Patrick thinks his team AC Bolognese will be victorious. Meanwhile, Steve is thinking about what to eat at supper.

Jack

“We haven’t lost to them in years. The cup is 90% ours. But, this is football; anything is possible. Well, that makes 10% anyway. Yeah, I am pretty sure of my team. If you want, let’s bet on it!”

Patrick

“We are the best team of the season. Plus, our striker scored 69 goals in 27 games. The cup is 75% ours. But, we have been unlucky against them. Which is why I am giving them 25%. Steve, I can bet on it right this second!”

Smart Steve

Steve is aware of the fact that either of these teams will be victorious as this is a cup final and there is no chance for a tie.

He would like to take advantage of his friends’ blindness. Steve would like to set such conditions for the bets such that he would profit whatever the result is.

What would you do if you were in Steve’s situation?

M. Serkan Kalaycıoğlu

Real MATHEMATICS – What are the chances?! #7

How Close?

Game: In a group, everyone is asked to pick a number between 0 and 100. Even though it is possible for more than one person to pick the same number, it is forbidden for participants to communicate with each other.

Winner: Winner is the person who is closest to the two-thirds of the average of the picked numbers.

Question: Is there any way for you to optimize your chance to win the game?

At first glance, one might think that it is not important which number you pick between 0 and 100. Because the winning number depends on the choices of others’. Although, if there is a player who has probability knowledge, he/she could maximize his/her chance for winning the game.

Step #1
Assume that we have a group of 12 people, and every individual selects 100. Then the average becomes:

12*100/12 = 100.

The winning number is the one that is closest to the two-thirds of the average. That means 100*2/3 = 66,666…

66,666… is the highest winning number for this game. If you are aware of this fact; then you would select a number that is between 0 and 66.

0-66

Obviously, there is a chance for you to win the game even though you select a number higher than 66. Then again; why would you select such a number if you know that the winning number is between 0 and 66?!

What if everyone realizes…?!

Let’s assume that you are aware of this fact. Then while others will pick a number between 0 and 100, you will be picking a number between 0 and 66. This is a huge advantage. But, suddenly you realized something else: What if everyone came to the same conclusion?

Step #2

If everyone knows that the winning number can’t exceed 66,666…, then no one will choose a number higher than 66. Hence, everyone will choose a number between 0 and 66.

In this situation, the highest average can be 66:

66*12/12 = 66 average.

66*2/3 = 44 is the highest winning number.

0-44

This means that if everyone selects between 0 and 66; the winning number can’t exceed 44. Then, why would you choose a number that is higher than 44?!

Step #3

If everyone comes to the same conclusion, then no one within the group will select a number that is higher than 44. This causes a new calculation. Since everyone knows that the winner will be between 0 and 44, the winning number can at most be:

44*12/12 = 44 (average)

44*2/3 = 29,333…

This means that the winning number is at most 29. Then no one will choose a number that is higher than 29.

0-29

If one follows the same logic, at the end of the 11th step he/she will find 0 (zero) as a result. This is why picking zero for everyone is the most logical move for the whole group. Using your probability knowledge, one will eventually conclude that zero is the most reasonable choice for each individual.

Conclusion

Mathematics can help a group find a solution that benefits everyone within the group, even though there is no communication inside that group of people.

One wonders…

You know a person inside the group who isn’t good at mathematics. In this situation, would you change your logic? Give your answers using probabilistic calculations.

Ps. You can click here and create yourself an example set.

M. Serkan Kalaycıoğlu

Real MATHEMATICS – What are the chances?! #6

How much luck?

Some people talk about how useless mathematics is. Maybe not all but most of these people lack the ability to understand probability of events, and they don’t even have any clue on how much damage they get because of that. Oddly enough whomever you ask, people will tell you how confident they are about probability.

One of the greatest examples for this is a casino game called roulette. If you have been to a casino before, you already know what I am going to talk about. For those who have no idea what roulette is, it is a gambling game in which a ball is dropped on to a revolving wheel with numbered compartments, the players betting on the number at which the ball comes to rest. Numbers on the wheel are between 0 and 36. Out of 37 numbers; 18 of them are colored in red, another 18 are black and only 1 of them (zero) is neither.

images55

In roulette one of the things you can gamble is color of the number. You can choose either red or black. It is not that hard to realize that the probability of red or black number winning the round is equal to each other and it is 18/37.

Q: Let’s say you are sitting on a roulette table and you observe that the last eight winners were all red. What would you bet on the next round: Red or black?

I asked ten of my friends and got these answers: 2 reds, 6 blacks and 2 “whatever”. Strange thing is nine of them said (without me asking them) that they know the probability is same in each round. It means that their choices were made instinctly, not mathematically.

The answer should be “whatever” as the probabilities stay the same in each round. Previous rounds have no effect on the next round. Except your psychology…

Warning: Gambling is the mother of all evil. Don’t do it!

“Are you a gambler?”

It is a multiplayer game. For “Are you a gambler?”, all you need is a standard dice.

indir (12)

Rules:

  • Players roll the dice in turns.
  • Outcomes of the rolls are added together. Goal is to be the first player who passes 50.
  • Whenever a player rolls 6, round ends for that player. Player also loses all the points he/she got in that round.
  • Players can stop their round whenever you want; as long as they don’t roll 6.

For instance if player A rolls 4 in the first round, he/she will get to choose one of the following two options: Roll the dice for the second time or end the round and add earned points (4 in this case) to his/her total. Let’s say player A decided to roll the dice second time and got 5. Again there will be two options for player A: Roll the dice for the third time or end the round and add (4+5=9 in this case) earned points to his/her total.

What to learn from all this?

There is only one number you avoid to roll and that is 6. This means whenever you roll the dice there is 5/6 = 0,833… (in other words 83%) chance that you will survive your round. Surviving two rolls consecutively has (5/6)*(5/6) = 0,694… probability. It means your chances have dropped to below 70% just after two rolls.

Imagine that you rolled a dice for 10 times. The probability of getting a 6 gets higher. (Almost 60%)

Although if one takes each roll individually probability of avoiding 6 never changes: 5/6. When you consider cases individually, you miss the bigger picture.

Unlikely events turn into most likely events within time. For instance getting a 6 after 100 rolls is almost certain:

Screenshot_20190326-155011_Calculator.jpg
99,99999879% you will get a 6.

Conclusion: If you roll a dice 100 times, it is almost certain that you will get a 6. But if you take a look at each roll, probability of getting a 6 is always 1/6. This is why unlikely event becomes the most likely event within time.

Then I ask you: When do you stop rolling while playing “Are you a gambler?”?

One wonders…

Let’s change “Are you a gambler?” a bit. Assume that:

  • You don’t have to avoid 6 anymore.
  • Whenever a player hits the total of 5, 10, 15, 20, 25, 30, 35, 40 or 45, player loses all of his/her points.

What kind of strategy would you use? What do you think is different from the original game?

M. Serkan Kalaycıoğlu

Real Mathematics – What are the chances?! #5

Youngest ones will approve this: It is usually youngest kid’s duty to run errands for home. This is why I was the minister of errands until I left home for college. Walking to our local market covered most of my daily duties. On an average day I was walking towards the market more than a few times. On top of that, my school was about 20 meters away from that market. I memorized every centimeter square of that street while growing up.

Actually I wasn’t bothered with this as I was able to create games in any kind of situation in my childhood. For example as I was walking down that street I dribbled with stones. I pretended that every little round stone is a foot ball and I was the famous French footballer Zinedine Zidane.

My favorite game was something I called “walking the line” which I still play by myself.

Walking the Line

In my old neighborhood, floor was tiled with these stones:

In the game of walking the line, goal is to step inside the boundaries of those stones. For every step that crossed the boundary I get -1 score as for each of the successful steps that landed inside the boundaries of the stone I got +1.

Q: Pick any step during a walk. What is the probability of that step being a successful one?

Assumptions:

  • Assume that the shape of the foot is a rectangle.
  • Let the foot has sizes 30×6 cm.
    20190212_134400
  • Assume that the shape of the stone tiling is a square.
  • Let the square has size 60×60 cm.
    20190212_134142
  • Assume that foot always has the same direction when it lands on the square:

20190212_134726

In order to take a successful step, foot can touch the boundary but never cross it. This actually means that the center of the foot (or the rectangle) must be inside a specific area.

20190212_134535
Center of the rectangle.

Let’s assume that the top of the rectangle touches the top side of the square. In this case rectangle’s center would be exactly 15 cm away from the side of the square:

20190212_134953

If this distance is less than 15 cm, it means that the rectangle crosses the boundary of the square:

20190212_135156

Although, when this distance is between 15 and 45 cm, rectangle is considered to be inside the boundary of the square:

20190212_135542

One can conclude the same for the lower side of the square.

It is also possible to observe that when the distance between the center of the rectangle and the boundary of the square is less than 3 cm, rectangle crosses the boundary of the square:

20190212_140123

Although, when this distance is between 3 and 57 cm, one can know that rectangle is inside the square:

Conclusion

Thus, the probability of taking a random step that is successful (inside the boundary of the square) on a squared-tiling, foot’s/rectangle’s center must be inside the following area S:

20190212_140917

Area of the square: 60*60 = 3600 cm2.

Area of S: 54*30 = 1620 cm2.

Probability of taking a successful step on a square:

1620/3600 = 0,45.

This means that for the given measurements it is possible to take a step that will not exceed the boundary of the squared-tiling 45% of the time.

20190212_161432

One wonders…

  1. Take a coin and a chess board. Flip the coin on the board. What is the probability of this coin landing inside one of the squares on the chess board?
  2. What are the sizes of the coin and the square when there is more than 50% chance of winning?

M. Serkan Kalaycıoğlu

Real Mathematics – What are the chances?! #4

Coffee of Serkan

Certain days of the week (okay; at least six days a week) I visit a specific coffee shop. Almost all the baristas know what I drink because of my frequent visits… Or do they?

My preferences change every six months. In the period of October-March, I only drink either latte or filter coffee, while in the period of April-September I prefer iced latte or berry.

October-March: In case I drink latte today, there are 80% of chances that I will be drinking latte in the next day. If I drink filter coffee today, chances of me drinking filter coffee tomorrow are 60%.

April-September: If I drink iced latte today, tomorrow I will be drinking iced latte with %80 of probability. For berry that probability is 90%.

20190205_195230
Diagram of my coffee selections in October-March period.

Question: If I drank filter coffee this morning, what are the chances that I will drink a latte 2 days later? (We are in February.)

This question resides one of the most crucial findings of mathematics with itself: Markov Chain.

20190205_194842
A Markov Chain example. I will be explaining what it is in details inside the article.

It is clear to see that there are two different possibilities to drink latte two days from now. Sum of their probabilities will give us our answer:

Probability of drinking filter coffee (0,6) the next day, and latte (0,4) two days later: 0,6*0,4 = 0,24.

Probability of drinking latter (0,4) the next day, and again latte (0,8) two days later: 0,4*0,8 = 0,32.

Probability of drinking latte two days from now: 0,24 + 0,32 = 0,56.

It means the chance is 56%.

One wonders…

  1. Does it matter which day of February it is today?
  2. Would it change the answer if you learn that I drank filter coffee yesterday? Please elaborate your answer.
  3. If I drink iced latte on June 11th, what is the probability of me drinking berry on June 14th?

Driverless Cars

In case you make a simple web search you will see that there are thousands of pages of articles that question where flying cars are. A few generations including mine have been dreaming about flying cars whenever we were just kids. “Back to the Future” was one of the main reasons why we had such dreams. And it is not like we expect time travel. We just want flying cars!

gelecege-donus-hakkinda-bilmedikleriniz,Z6sLULxzT02ta5L2MlbZvA

It is 2019 and there are still no flying cars around. Technology developed as much as making driverless cars only. (Only?!)

Decision making systems are among the key technologies needed for building driverless cars. Because a self-driving car will make hundreds of decisions even if it travels short distances.

Gist of decision making systems is the Markov Chain I mentioned in the Serkan’s Coffee. A concept known as Markov Decision Process is the powerful tool that is being used for driverless cars.

Markov Decision Process (MDP): It is a mathematically formulation for decision and control problems with uncertain behavior.

Memory-less Probability

Markov Chain: If there is Markov Chain inside an event or system, future of that system depends only at the current state of the system; not to its past. And it is possible to predict the future of that system.

One of the examples of Markov Chain is Drunkard’s Walk. Reminder: A drunkard makes random decisions while he/she is trying to find his/her home. Assume that the drunkard had made these moves:

rand1

Drunkard’s next move will not depend on the previous moves he/she had made. This only depends on his/her current state and probabilities of the possible moves.

rand2
If drunkard will move from the point F, there are four possibilities and none of them depend on previous steps the drunkard took.

It goes the same for driverless cars: Decisions will not depend on the previous ones. For example if a driverless car is heading towards traffic lights its decision will depend on the color of the traffic light; not the left turn it made 200 meters behind.

Markov Chain was found more than 100 years ago and it is being used in economy, meteorology, biology, game theory and even modern technologies like driverless cars and voice recognition systems.

Mathematician Family

The person who gave Markov Chain its name is a Russian mathematician called Andrei Markov. His little brother, Vladimir Markov, was also internationally recognized mathematician. Vladimir died because of tuberculosis at the age of 25. Andrei’s son Andrei Markov Jr. was also a mathematician.

Politics and Andrei

Andrei Markov was involved with politics too. He was not in favor of Romanov dynasty which ruled Russia between 1613 and 1917. He showed his opposition with not participating in the 300th year celebration of Romanov dynasty in 1913. Instead he celebrated 200th year anniversary of the Law of Large Numbers! (I’ll get back to Law of Large Numbers later.)

M. Serkan Kalaycıoğlu

Real Mathematics – What are the chances?! #3

Thinking of a number

I am thinking of a number from 1 to 10. (It is 6.)

You have to guess this number.

You have only one shot which means that your success rate is 1 in 10. In other words it is 10%.

Let’s reverse this train of thought and only consider rate of failure which is 90%. (100-10=90)

Q: Assume that we have a group of five people. We ask everyone to write down a number from 1 to 10 simultaneously. What is the probability of having at least 2 people writing down the same number?

First answer comes to your mind is 50%, isn’t it? Because 5 out of 10 makes 50%. Although things may not be as they seem in probability theory.

We’ve already talked about this case for two people. Probability was 9/10 or 90%. How about for three people?

For the first person, there are 10 available numbers from 1 to 10: 10/10.

For the second one, there are 9 available numbers from 1 to 10: 9/10.

For the third person, there are 8 available numbers from 1 to 10: 8/10.

Probability of these three cases to happen can be calculated with multiplication of them: (10/10)*(9/10)*(8/10) = 0,72. This means that %72 of the time three people will write down different numbers.

For four people probability can be calculated like this: (10/10)*(9/10)*(8/10)*(7/10) = 0,504. This means that 50,4% of the time four people will write down different numbers.

For five people probability will be: (10/10)*(9/10)*(8/10)*(7/10)*(6/10) = 0,3024. This means that 30% of the time five people will write down different numbers from 1 to 10.

Probability is way above 50%. Are you surprised?

Birthday Paradox

Whenever you meet someone new, the day you were born will be one of the subjects of this first conversation. If there is at least one female in that conversation your horoscope signs will definitely be mentioned. Now think for a second: Have you ever met someone who shared the same birthday with you?

You probably haven’t thought about it since you know that it is a highly unlikely thing. Because if you consider one year as 365 days (sorry 29th of February)this probability is 1 over 365 which makes 0,27%.

Q: How many people do you need in a group to have 50% chance that two of them will have the same birthday?

At first you might think that you would need 365/2 people for that. But this is not the true answer.

This question can be answered with the same logic we used for the thinking of a number game. And when you apply the same method, you will end up with a bizarre result: Only 23 people are needed for such probability!

Let’s start analyzing this result slowly as we did in the thinking of a number game.

For the first person there will be 365 available days out of 365 total days.

For the second person there will be 364 available days out of 365 total days.

For the third person there will be 363 available days out of 365 total days.

üççarp

For three people, not having same birthday is 99,2%.

dörtçarp

For four people it is 98,4%.

onçarp

For ten people it is 88,3%. As we continue calculating we can see for 23 people it is 49,3%.

23çarp

This means that 50,7% of the time two people will have the same birthday among a group of 23 people.

This is an astonishing result!

One wonders…

Determine how many people do you need in a group such that 99% of the time you will be able to find two people who will have the same birthdays?

M. Serkan Kalaycıoğlu

Real Mathematics – What are the chances?! #2

Roommate Pigeons

It makes me really happy whenever I discover a fact in mathematics which has incredible depth even though it looks really simple and obvious in the begining. One of these facts is called pigeonhole principle. It is also known as Dirichlet’s box.

Dirichlet’s Box: German mathematician Lejeune Dirichlet first mentioned his pigeonhole principle in 1834. According to him if more than n objects are placed into n boxes, there will be at least one box that has more than one object.

Raising pigeons is a common tradition in most cities of Turkey. Mardin is one of the leading ones of those cities. Tumbler pigeons of Mardin are really famous.

Let’s say you met a guy who raises tumbler pigeons. He is so enthusiastic about his pigeons; he even built little houses for them. However, you counted the numbers of pigeons and little pigeon houses and you realized that there are more pigeons than pigeon houses. In this case you’ve come to the conclusion that at least one of the houses must have at least two pigeons. In other words, there are pigeons who are roommates.

1200px-TooManyPigeons

For instance if you have 10 pigeon houses and 11 pigeons, whenever you put pigeons into their houses, one pigeon will always be left outside. And that pigeon will have to be a roommate to one of those 10 pigeons.

It doesn’t matter what kind of order is being used. In the end there will be a pigeon who will have to share his/her house with another pigeon.

This is the pigeonhole principle.

Game

Are you in a crowded room now? If not, go to a Starbucks and drink a coffee on me. Yes, you can send me the bill. We need crowd for this game.

Look around now: There are at least 2 people who know the same number of person in that room/place.

Rules

  1. There must be more than 2 people in the room.
  2. Knowing someone is mutual. If Sean Connery is in the next table, unless he knows who you are too, you can’t count him as someone you know.
  3. A person should know himself/herself. But, you should do it in your private time. In this game, you can’t count yourself as a person you know.

Example: A group of 5.

In such group, one person can know at most 4 people. (Everyone except him/herself) Also one person can know at least 0 (zero) person. Then we can conclude that in this group of 5, everyone can get to know either one of 0, 1, 2, 3, 4 number of person.

Although in this group if someone knows 0 (zero) number of person, then there can’t be such person who knows 4 people in the same group.

IMG_6148
If e knows 0 (zero) number of person, then a can’t know 4 number of person.

This is why these 5 people can know 0, 1, 2, 3 or 1, 2, 3, 4 numbers of person. We can’t have 0 and 4 at the same group.

Thus, we should assign either one of these 4 numbers to 5 people. Can you see the pigeons?

a. 1, 2, 3, 4

IMG_6153

First four people will get 1, 2, 3 and 4 respectively (It doesn’t have to be respectively though. You can use any order you’d like.). Fifth person is left without a number and must be assigned to either one of 1, 2, 3 or 4. No matter which number that person takes, there will be two people that know same number of person.

b. 0, 1, 2, 3

IMG_6152

First four people will get 0, 1, 2 and 3 respectively. Fifth person is left without a number and will get either one of those four numbers. Hence there will be two people that have the same number.

One wonders…

Imagine a 5×5 chess board. Every square of the board has a chocolate placed on it. Every chocolate can only be put to an adjacent square on the board. (Two squares are adjacent if they share an edge.)

Chocolates can move to other squares as shown in the photos.

Assume that we moved every chocolate on the board. In the end, will there be exactly one chocolate in every square?

M. Serkan Kalaycıoğlu

Real Mathematics: What are the chances?! #1

In 1987, Thomas M. Cover from Stanford University published an article which contained a bizarre result. Cover suggested the following question:

Player A and Player B will get into a competition.

Player A will be writing down distinct numbers on two pieces of papers, while Player B will be choosing one of the papers and will be reading the number written on it. Then Player B will have to decide if the bigger number is on his/her paper, or on the other one.

Naturally, Player B’s chance of finding the bigger number is 50%. In fact knowing one of the numbers has no use for his chance… or not?

Magic of Mathematics

Is there a strategy for Player B to use so that he/she will have more than 50% chance to win the game?

Although it sounds unlikely, there really is a strategy which Player B could use to win the game with a probability that is greater than 50%.

Strategy: Player B thinks of a number T on his/her mind. Every time Player B selects a paper, he/she uses T for comparison.

  • If T is greater than the selected number, Player B chooses the other paper.
  • If T is smaller than the selected number, Player B chooses the selected paper.

Theory

Let’s assume x and y are the numbers that are written on the papers. (x is greater than y) There are exactly three different scenarios for the game:

  1. T is smaller than x and y. In this case Player B has exactly 50% chance of winning the game.
    kucuk
  2. T is greater than both x and y. In this case Player B again has 50% chance of winning the game.
    BUYUK
  3. T is greater than y, less than x. In this case if Player B picks y, since T is greater than y, he/she will be choosing the other paper. And if Player B picks x, since T is less than x, he/she will be choosing the paper he/she picked. In both situations Player B wins the game which gives Player B a 100% chance of winning the game.
    orta

An Example

I will try to explain these three scenarios with an example.

Assume T is 80 and x and y are;

  1. 120 and 287,
  2. 1 and 2,
  3. 64 and 15000.

Solutions:

  1. Player B picks either 120 or 287. Since both numbers are greater than T (which is 80), Player B sticks with the paper he/she picks. In this case probability of picking 287 is exactly 50%.
  2. Player B picks either 1 or 2. Since both numbers are less than T, Player B claims the other paper has the greater number on it. In this case probability of picking 1 is again exactly 50%.
  3. Player B picks either 64 or 15000. T is between these numbers. If Player B picks 64, since it is less than T, Player B would pick the other paper. If Player B picks 15000, since it is greater than T, Player B would claim that the paper he/she picked is the greater number. In both cases Player B wins, which gives him/her a probability of 100% for winning the game.