Real MATHEMATICS – Graphs #6

Bequeath Problem

King Serkan I decides to allocate his lands to his children. Obviously he had set up some ground rules for the allocation:

  • Each child will get at least one land.
  • Same child can’t have adjacent lands.

Problem: At least how many children should Serkan I has so that allocation can be done without a problem?

Map #1

Let’s start from a simple map:

20190423_000256.jpg

In this case Serkan I can have two children:

20190423_000310.jpg

As you can remember from the previous article a map and a graph is irreversible. If we represent lands with dots, and let two dots be connected with a line if they are adjacent, we can show maps as graphs:

20190423_000334.jpg

Let’s add another land to this map:

20190423_000402.jpg

Adding a land on a map is the same thing as adding a dot on a graph:

20190423_000507.jpg

Map #2

Let’s assume there are three lands on a map:

20190423_000523.jpg

We can convert this map into graph as follows:

20190423_000537.jpg

As seen above, three children are needed in order to fulfill Serkan I’s rules:

20190423_000553.jpg

Map #3

Let the third map be the following:

20190423_000627.jpg

According to Serkan I’s rules, we will need four children for such map:

20190423_000642.jpg

Map #3 can be shown as a graph like the following:

20190423_000728.jpg

Map #4

For the final map, let’s assume Serkan I left a map that looks like USA’s map:

480271690e1e0485f71988e273730559

Surprisingly four children are enough in order to allocate the lands on the map of USA:

amarikaaa

What is going on?

Careful readers already noticed that adding a dot that connects the other dots in the second map’s graph gives the graph of the third map. Same thing is true for the first and second maps:

Hence, adding a new dot to the graph means adding a new child.

Q: Is it possible to create a map that requires at least five children?

In other words: Is it possible to add a fifth dot to the graph so that it has connection to all existing four dots? (Ps: There can be no crossing in a graph as our maps are planar.)

Then, all we have to do is to add that fifth dot… Nevertheless I can’t seem to do it. When I add the fifth dot outside of the following graph:

It is impossible to connect 1 and 5 without crossing another line. No matter what I try, I can’t do it:

Four Color Theorem

About 160 years ago Francis Guthrie was thinking about coloring maps:

“Can the areas on any map be colored with at most four colors such that no pair of neighboring areas get the same color?”

Incredibly the answer is yes.

This simple problem was introduced for the first time by Francis Guthrie in 1852. Not until 1976 there was no proof for Guthrie’s conjecture. Only then with the help of computers the conjecture was proved. This proof is crucial for mathematics world as it is known as the mathematical theorem that was proven with the help of computers.

One wonders…

20190423_003916.jpg

Add a fourth dot to the graph you see above and connect that dot to the existing dots. (You are free to place the fourth dot wherever you want on the graph.)

Now check your graph: One of those four dots is trapped inside the lines, isn’t it?

Can you fix that?

Explain how you can/can’t do it.

M. Serkan Kalaycıoğlu

Real MATHEMATICS – Graphs #5

Cruel Traffic Light

I have to drive past the same crossroad almost every single day. Obviously I stop at the longest-lasting traffic light of the crossroad. Within time I started loving these moments because it gave me a chance to think my life over. Though, it doesn’t take too long for me to start thinking about mathematics.

One of those days I found myself questioning the traffic lights and their relationship with mathematics. (After all mathematics is everywhere; isn’t it?) Soon after I realized that there was my beloved graph theory behind traffic lights.

Light #1

Let’s assume a one-way street with two traffic lights: One for the vehicles (we’ll call it A), other for the pedestrians (we’ll call it B):

20190419_014641.jpg

In such situation we have to avoid accidents. This means whenever A has green light, B must have red light and vice versa. We will not take account of the situation when both lights are red. Because even though there won’t be any accident, neither of the sides will be standing still (which is nonsense):

20190419_014737.jpg

All these can be shown using graph theory: Lights will be represented by dots. Dots in a graph will be connected with lines if they are not in the same color:

20190419_014752.jpg

Same thing can be shown with maps: If A and B are two neighboring countries, they should be colored in different colors to avoid confusion:

20190419_014817.jpg

Light #2

This time we will assume a two-way street with three traffic lights: Two for the vehicles from opposite sides (we’ll call them A and B), and one for the pedestrians (we’ll call that C):

20190419_014838.jpg

In such a situation when C is red, either or both of A and B should be green. When C is green, then both A and B should be red:

20190419_014912.jpg

We’ll skip the situation where all three of them are red as no one would move in such situation.

We can show these using graph theory and map coloring as follows:

20190419_014930.jpg

Since we set all the rules graphs make it much easier and clearer to understand the situations.

Light #3

Finally we have a two-way street (A and B), a right turn (C) and two pedestrian lights (D and E) as follows:

20190419_014947.jpg

This time it is a much complex situation:

20190419_015030.jpg

Although using graph theory makes it all easier for us to understand:

How Many Colors?

We will color the following graphs using the same rules we just established above: If two dots are connected with a line, then those dots must have different colors.

Chromatic Numbers: Whenever a graph is being colored, ambition is the use the least number of colors. This number is also known as the chromatic number of a graph.

Here we need 3 colors. Hence chromatic number of the graph is 3. Let’s add one more dot and line to the graph:

This time chromatic number of the graph becomes 2. We’ll add another dot and line:

Now chromatic number becomes 3 again. Let’s add a dot and a line for the last time:

Chromatic number is back to 2.

To be continued…

One Wonders…

What did just happen? What did you notice? Why is it happening?

How can you increase the chromatic number?

M. Serkan Kalaycıoğlu

Real MATHEMATICS – Graphs #4

I visited the world famous Hermitage museum in Saint Petersburg (Russia) back in 2014. Hermitage is so huge that it has 1057 rooms and one would have to walk around 22 km to see all the rooms. And numbers of artistic & historical items are not that shallow either: It is believe that it would take a little over 11 years if one would spare 1 minute for each piece of art.

hermitage-map-st-petersburg
Map of Hermitage.

Now you can relate why I had trouble when I wanted to visit Hermitage for a few hours. I didn’t have enough time and I wanted to see important art works such as the Dessert: Harmony in Red by Henri Matisse. Eventually I realized that this is a problem I had faced before.

Actually, each and every one of you must have faced such problems in your daily lives. Most common one: “Which route you should take between home and work during rush hour traffic?”

Postman’s Path

Facing such problem in Saint Petersburg is a pleasing coincidence as this magnificent city once was home to one of the giants of mathematics: Leonhard Euler. If you take a look at the first article of graphs you can see that Euler is the person who initiated the discovery of Graph Theory with his solution to the famous Seven Bridges of Königsberg problem.

In 1960 (almost 230 years after the solution of Königsberg) a Chinese mathematician named Mei-Ko Kwan took a similar problem into his hands:

A postman has to deliver letters to a given neighborhood. He needs to walk through all the streets in the neighborhood and back to the post-office. How can he design his route so that he walks the shortest distance?

indir
Mei-Ko Kwan

This problem is given the name Chinese Postman Problem as an appreciation to Kwan. There are a few things you should know about the postman problem:

  • Postman must walk each street once.
  • Start and finish point must be at the post-office.
  • Postman must fulfill these two conditions in the shortest possible time.

Power of Graphs

Mei-Ko Kwan turned to Euler’s Königsberg solution in order to solve the postman problem. According to Kwan postman problem could have been shown as a graph: Lines represent the streets and letters represent the houses.

Example Graph:

20190324_210039
A, B, C, D and E are the houses as the lines are the streets. The numbers above the lines show how much time it takes to walk from one house to another.
Reminder (You can read the first three articles of Graphs and learn the detail of the following.)
What is an Euler circuit?
Euler circuit is a walk through a graph which uses every edge (line) exactly once. In an Euler circuit walk must start and finish at the same vertex (point).
How do we spot an Euler circuit?
A graph has an Euler circuit if and only if the degree of every vertex is even. In other words, for each vertex (point) count the number of edges (lines) it has. If that number is even for each vertex, then it is safe to say that our graph has an Euler circuit.

Solution

As you can see above, if the degree of every vertex in a graph is even, then we can conclude that the graph has an Euler circuit. Let’s assume that the following is our graph:

20190325_123338.jpg
The numbers above each line represents the distances (e.g. in km) between the points.

First of all we must determine the degree of each vertex:

20190325_123326.jpg

As seen above all the vertices have even degrees. This is how we can conclude that the graph has an Euler circuit even without trying to find the path itself. Hence the postman can use the existent roads and finish his route in the shortest time:

20190325_123311.jpg
The shortest path takes 11 km.

When a graph has vertices with odd degrees, then we must add new line(s) to the graph in order to create an Euler circuit. These are the steps you can follow:

  1. Find the vertices that have odd degrees.
  2. Split these vertices into pairs.
  3. Find the distance for each pair and compare them. The shortest pair(s) shows where to add new line(s).
  4. Add the line(s) to the graph.

Let’s use an example and test Kwan’s algorithm for the solution. Assume that A is the starting point. First we must check the degrees of the vertices:

20190324_210039

Unfortunately A and D have odd degrees which is why the postman can’t finish his walk:

20190324_210102

Here we have only one pair that is A-D. There are three routes between A-D. If we find the shortest one and add that to our graph, we will have an Euler circuit:

20190324_210157

The shortest one is the line between A-D as seen above. If we add that line, we will have the shortest route for the postman:

One wonders…

If the post office is at A, what is the route for the postman to take so that he will finish his day in the shortest way?

20190324_210225

M. Serkan Kalaycıoğlu

Real Mathematics – Puzzle #1

Crossing the River

A farmer is walking back home with a wolf, a goat and some lettuce. As he was on his way a river appears in front of him. Luckily for him, he sees an abandoned boat. Though it turned out the boat was not big enough for all of them. Farmer had to choose either one of the wolf, goat or lettuce in each time he crosses the river.

But there was a catch here: If they are left alone wolf would eat the goat and goat would eat the lettuce. What is farmer’s strategy in order to cross this river? (P.s: It is not possible to swim across the river.)

farmer-wolf-goat-cabbage

The Answer

kec3a7iik

Between these three only wolf and lettuce can be left alone. Then farmer should start the process with carrying the goat to the right side of the river.

lahank

Then he should return the left side and picks up either of the wolf or the lettuce. (Let’s assume that he picks the lettuce.) Farmer reaches the right side of the river with the lettuce. Now before he leaves he realizes that lettuce and goat can’t be left alone. So he takes the goat with him to the left side.

kurtk

Now, lettuce is alone on the right side of the river as farmer, goat and the wolf are all on the left side. At this point farmer should carry the wolf to the right side and leaves it there with the lettuce as lettuce and wolf can be left alone without a problem.

hepsik

In the end farmer can go back to the left side of the river and takes the goat to the right side. Hence the problem gets solved.

There wouldn’t be a solution for this puzzle if wolf was eating the lettuce. But, in order to understand that we had to check every possible variation. This would have been a waste of time and energy. Thus we haven’t found an actual method for the solution of this puzzle.

River Algorithm

Graph Theory is a relatively new subject of mathematics. In Graph Theory what matters is the placement and the connection; not the shape. In this part of mathematics objects are described with dots and connections with lines. Then wolf, goat and the lettuce can be represented as dots. Only connection between these three is whether they eat one another or not. In the puzzle goat eats lettuce and wolf eats goat. Hence connections (or lines) should be between them.

If dot disappears, then the connections within disappears as well. In the puzzle we can take only one dot at a time. In the first move we choose the goat. This can be shown in graph as follows:

adsız

Deleting the goat dot means to delete the lines connected to it. Graph has no line after the first move which is what we want to accomplish and we managed to do it with deleting only 1 dot. This means another thing: In order to solve the puzzle there must be as many spaces as the deleted dots in the boat.

adsız2

Let me explain this with an example: Assume that we have to take at least n dots away from the graph in order to get rid of all the lines. This means if boat has n empty spaces the puzzle can be solved.

Let’s add a rabbit to this puzzle.

Second River Puzzle

Now farmer has a goat, a wolf, some lettuce and a rabbit. On top of the previous puzzle rabbit eats the lettuce and wolf eats the rabbit.

adsız3

In the first puzzle we took goat’s dot and saw that there was no line left in the graph. But in the second puzzle none of the four dots is able to extinguish all the lines of the graph.

This is why in order to extinguish all the lines; we must try to remove at least two dots. For instance:

adsız8

As seen above when we take goat and the rabbit, all the lines inside the graph disappears. Using graphs we found an algorithm and with that algorithm we know that the boat must have at least 2 spaces in order to solve the second puzzle.

One Wonders…

  1. Solve the second puzzle.
  2. Let’s add carrot, cat and mice to the second puzzle. Goat, rabbit and mice eats the carrot and cat eats the mice. Try to find how big the boat should be and solve the puzzle for that boat.

M. Serkan Kalaycıoğlu

Real Mathematics – Geometry #8

Right way to cut a round cake

Almost everyone thinks of the same shape when someone mentions “a slice of round cake”:

However, this is not the correct way to cut a round cake. A letter was published in Nature magazine in December 20, 1906. It was written by a famous British scientist Francis Galton. Galton claimed that traditional way of cutting a round cake was faulty as after the cut exposed surfaces of the cake would start becoming dry almost instantly.

keks
Francis Galton’s letter.

Therefore he claimed that he found a “scientific principle” to cut a round cake.

Scientific way of cutting a cake is shown below:

IMG_5755

First Blood: Imagine two lines that are both parallel to the diameter and only a short distance away from it. As Galton suggested, one should cut the cake through these imaginary lines. Hence, exposed surfaces are same and they could be brought together. In order to keep the cake at a stable one piece position, you could use a rubber band.

Second Cut: You can do that like the first cut, but perpendicular to those cuts. In the end you would end up with four pieces of cake. They can be stuck together with a rubber band again.

This is the “scientific” way to keep your cake fresh.

In case you’d like to try Galton’s method without using a cake, all you need is a circle drawn on a paper:

One wonders…

Assume that you are on a Sunday brunch with your friends and pancakes arrived to the table. You realized that the waiter brought one extra pancake and everyone in the table wants that freebee.

24COOKING-CLASSICPANCAKES-videoSixteenByNineJumbo1600

You all agreed to play a game in order to decide who gets the pancake.

Game: Everyone has a pancake on their plate. Everyone will try to cut his/her pancake to most pieces with three straight cuts. (You are not allowed to move the pieces of the pancake.) Winner(s) will get the pancake.

M. Serkan Kalaycıoğlu