-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Problems 05-05-21 #107
Changes from 10 commits
bfc726e
5bd84d2
a2ad122
79d3690
ce8470c
f83b4df
bca1490
0555b95
1e64a4b
1b4a427
5474c6f
5d22fb6
c0f8c24
682417e
d295add
e655a0b
ed10224
67954ab
dcd7d1a
5a18f6d
895fe0d
c3b9d0d
1f4974c
eefb64a
3d60e6a
6a9ff3f
70fa09a
8cc8679
26e4fdb
eb5bcf6
61bcff4
a168f05
7521163
99412dc
4c83beb
caf13a7
c552328
f5bc116
d5f9893
3806eb1
9e00dfc
1248f86
32a4af6
e3b3777
9c937d1
b93d784
c4692d0
80ab366
0b1a984
00c96a2
e6304a8
4ce7073
87d1c7f
2822ece
8d8e2c0
5c615cf
2f07132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Colouring Maps | ||
|
||
## Introduction | ||
|
||
This seemingly simple problem manages to disguise some very nice mathematics related to the field of graph theory. | ||
|
||
Students may design their own maps or use the one given in the question, they should not need more than four colours to fill their map, although they will not know this initially (see Extension section for proof). | ||
|
||
## Solution | ||
|
||
For the map given in the question, we can show that the map can be coloured using four colours. In fact, we will see that it cannot be done in any fewer. | ||
|
||
The majority of the map can be coloured using just two colours, take blue and green: | ||
|
||
<img src="../../images/colouring-maps-3.png" width=300> | ||
|
||
At this point, we wish to colour the region in the top left corner. Since it shares edges with both blue and green regions, we must introduce a third colour, say red. This is also true for the region in the bottom right corner. | ||
|
||
<img src="../../images/colouring-maps-4.png" width=300> | ||
|
||
Now we want to colour the star-shaped region. However, the star shares edges with a blue, a green and a red region so we must introduce a fourth colour. Yellow seems appropriate. | ||
|
||
<img src="../../images/colouring-maps-5.png" width=300> | ||
|
||
And so, we have coloured this map using exactly four colours. Clearly, we could have used more colours (we could, for example, use a different colour for each of the 29 sections). But, having seen that we were required to introduce four different colours, we could not have used less. | ||
|
||
## Extension | ||
|
||
We can ask the question, is there a smallest number of colours which will be able to colour in any given map? The answer is yes, and it is 4. Students may notice this pattern from trying lots of different maps, however showing it conclusively is a problem that went unsolved for many years. The proof of this problem is considered to be the first computer-aided proof of a major theorem. | ||
|
||
While we cannot tackle the entire problem here, we can prove a simpler result. We will show that we can always colour a map with *five regions* using a maximum of four colours. In order to do this, we first need to think of our maps in a slightly different way. | ||
|
||
Specifically, we are going to translate the maps into mathematical *graphs* (likely not the type of graph that you are used to). To do this we will: | ||
- Replace the different regions on the map with circles. | ||
- Connect up the circles representing regions which share edges using lines. | ||
|
||
(We usually refer to these circles as *vertices*, and the lines as *edges*. This is somewhat confusing, but "edges" is used with two different meanings in this question. It can refer to the boundaries of a region, or a connection between vertices.) | ||
|
||
Let us take a portion of the example map and turn it into a graph. For the part in the bottom-right corner: | ||
|
||
<img src="../../images/colouring-maps-6.png" width=300> | ||
|
||
Notice how our previous rule, that regions which share an edge cannot be the same colour, is maintained in the graph as no two connected vertices can be of the same colour. | ||
|
||
Also notice that the graph does not have any intersecting edges. In fact, any graph which represents a valid map can be drawn without any edges intersecting. | ||
|
||
Knowing these two things will allow us to prove that we can always colour a five-region map using four colours or less. This is equivalentl to the statement that it is not possible to construct a map with five-regions which requires five different colours. Such a map would be represented by a five-vertex graph where each vertex is connected to the other four and so none can have the same colour. We can attempt to construct such a graph to see that it is impossible. | ||
|
||
Firstly, from the example map, it is possible to make a graph with four vertices where all are connected to each other and none of the lines intersect: | ||
|
||
<img src="../../images/colouring-maps-7.png" width=200> | ||
|
||
If we now try to add a fifth vertex, there are 4 areas where we could try to do so: | ||
- In any of the three small triangles formed by connecting the Yellow vertex with two others. | ||
- Outside the large triangle formed by the Red, Green and Blue vertices. | ||
|
||
<img src="../../images/colouring-maps-8.png" width=200> | ||
|
||
However, in each case, we can only connect up the additional vertex to three others without any edges crossing. This means that they do not, in fact, have to take a new colour and we can still colour the graph with four colours. | ||
|
||
<img src="../../images/colouring-maps-9.png" width=200> | ||
|
||
So, we have shown that we cannot construct a five-vertex graph requiring five different colours to fill. | ||
|
||
Equivalently, we cannot draw a five-region map which needs five different colours to fill. | ||
|
||
*(As previously stated, this property is in fact true for all maps and was shown to be so by mathematicians Appel and Haken, 1976)* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# MiniMax Algorithm | ||
|
||
## Introduction | ||
|
||
These games provide a introduction to the *MiniMax Algorithm*, an important tool in computer science and “game theory”. The MiniMax Algorithm is a method to work out the best way to act in order to minimise loses, or to achieve the *best outcome in a worstcase scenario* (like if our opponent plays optimally). | ||
|
||
The first game is deliberately simpler, and hopefully students will be able to apply the same principles to a more complicated example in the second game (see Extension Section). | ||
|
||
## Solution | ||
|
||
For the first game, say we are trying to achieve the highest score possible and our opponent the lowest (as in part a). | ||
|
||
We know that our opponent will get the second move, and so they will choose the lowest of the two options available to them. As such, we can predict how they will move from each possible point. | ||
|
||
<img src="../../images/minimax-3.png" width=300> | ||
|
||
So, if we move to the left, our opponent will move right to score 3. If we move right, our opponent will move left to score 4. This means that we will get a higher score from moving right, so that is what we should do. | ||
|
||
This is despite the fact that, ideally, we would like to land on the 9, the highest result. However, since we know that our opponent is going to choose the lower of the two options, by moving right we *achieve the best outcome from the worst-case scenario*. | ||
|
||
This process of working backwards, considering the result of being in each position, is how the MiniMax Algorithm works. | ||
|
||
By the same logic, for part b, we should more right to obtain the lowest score possible. This way we will get a 6, whereas moving left we would get a 9. | ||
|
||
## Extension | ||
|
||
For the second game, there are many more possible routes through the map, making the situation more complicated. But by working backwards and applying the same logic, we can work out how to play optimally. | ||
|
||
Starting by considering our opponents move on the second to bottom row, from which they will always choose the minimise the total by moving to the smaller of their two options: | ||
|
||
- If they are moving from the 0, they will go right to the −1. | ||
- If they are moving from the leftmost +2, they will go left to the −1. | ||
- If they are moving from the rightmost +2, they will go left to the 0. | ||
- If they are moving from the leftmost −1, they will move right to the +1. | ||
- If they are moving from the −2, they will move left to the +1. | ||
- If they are moving from the rightmost −1, they will move right to the −1. | ||
|
||
So, when choosing our move from the third to bottom row, we must consider the total result of each direction including how our opponent will move subsequently (in blue below). | ||
|
||
<img src="../../images/minimax-4.png" width=400> | ||
|
||
Wishing to achieve the highest total possible, we should choose to move to the largest total (blue number) possible from any position: | ||
|
||
<img src="../../images/minimax-5.png" width=400> | ||
|
||
Notice how, from the 0, even though the choice is between two ‘+2’s the total achieved from each move is different. We should move right for a better overall score. | ||
|
||
From this point, our opponent (playing optimally) will move from any point in the fourth to bottom row to minimise the total achieved. And we can continue this process of deduction upwards through each row: | ||
|
||
<img src="../../images/minimax-6.png" width=400> | ||
|
||
And so, knowing how each player should move from any given position, we can deduce the route which the game will take if each player plays optimally: | ||
|
||
<img src="../../images/minimax-7.png" width=400> | ||
|
||
Counter-intuitively, to score the highest total, we should move to the +1 on our first turn as opposed to the +2! This will allow us to get an overall total of +1, whereas by moving to the +2 the best we can get is 0. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Colouring Maps | ||
type: problem | ||
printOrder: n/a | ||
added: 2021-01 | ||
--- | ||
|
||
# Colouring Maps | ||
|
||
Start by drawing an empty square: | ||
|
||
<img src="../../images/colouring-maps-1.png" width=200> | ||
|
||
Create a *map* by dividing the square into seperate regions. For example: | ||
|
||
<img src="../../images/colouring-maps-2.png" width=200> | ||
|
||
Now colour in your map such that there are no regions of the same colour which share an edge. | ||
|
||
Try to find the smallest number of different colours which you need to be able to do this. | ||
|
||
What about other maps, can you find a certain number of colours which are able to colour in any map? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you maybe add a small example of a correctly coloured and incorrectly coloured group of sections (doesn't have to be the full image, could just be a small part of it)? Also perhaps you could add a comment to say - "If you don't have colours, you can try shading in different ways such as with dots, crosses or stripes" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: MiniMax Algorithm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the title will be converted into a slug and used to reference the markdown file, so |
||
type: problem | ||
printOrder: n/a | ||
added: 2021-01 | ||
--- | ||
|
||
# MiniMax Algorithm | ||
|
||
Here is a *map* for a game: | ||
|
||
<img src="../../images/minimax-1.png" width=300> | ||
|
||
Starting at the top point, you can choose to move down the map either to the left or the right. From here, your opponent then chooses to move down left or right to one of the numbers. | ||
How should you play if: | ||
a. You want to end on the highest number possible and your opponent wants to end on the smallest number possible? | ||
b. You want to end on the smallest number possible and your opponent want to end on the largest number possible? | ||
|
||
Here is another map: | ||
|
||
<img src="../../images/minimax-2.png" width=300> | ||
|
||
Again starting at the top, you and your opponent take turns to move either left or right down the map, you get the first move. Starting at 0, add or subtract each number that you or you opponent lands on for a combined total. You should try to score the highest total possible, and your opponent will try to score the lowest. | ||
|
||
Assuming you and your opponent both play optimally, what route will be taken and what will the final score be? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to change both problems
added
to2021-03
, just to make sure they take top priority in the app