Skip to content
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

Merged
merged 57 commits into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
bfc726e
Merge pull request #1 from supportingami/master
dankelly01 Feb 15, 2021
5bd84d2
Create minimax
dankelly01 Feb 26, 2021
a2ad122
Create minimax.md
dankelly01 Feb 26, 2021
79d3690
Rename minimax to minimax.md
dankelly01 Feb 26, 2021
ce8470c
Add files via upload
dankelly01 Feb 26, 2021
f83b4df
Add files via upload
dankelly01 Feb 26, 2021
bca1490
Create colouring-maps.md
dankelly01 Feb 26, 2021
0555b95
Create colouring-maps.md
dankelly01 Feb 26, 2021
1e64a4b
Add files via upload
dankelly01 Feb 26, 2021
1b4a427
Add files via upload
dankelly01 Feb 26, 2021
5474c6f
Update minimax.md
dankelly01 Mar 10, 2021
5d22fb6
Merge pull request #2 from supportingami/master
dankelly01 Mar 10, 2021
c0f8c24
Update colouring-maps.md
dankelly01 Mar 10, 2021
682417e
Update colouring-maps.md
dankelly01 Mar 10, 2021
d295add
Delete colouring-maps-1.png
dankelly01 Mar 10, 2021
e655a0b
Delete colouring-maps-2.png
dankelly01 Mar 10, 2021
ed10224
Delete colouring-maps-3.png
dankelly01 Mar 10, 2021
67954ab
Delete colouring-maps-4.png
dankelly01 Mar 10, 2021
dcd7d1a
Delete colouring-maps-5.png
dankelly01 Mar 10, 2021
5a18f6d
Delete colouring-maps-6.png
dankelly01 Mar 10, 2021
895fe0d
Delete colouring-maps-7.png
dankelly01 Mar 10, 2021
c3b9d0d
Delete colouring-maps-8.png
dankelly01 Mar 10, 2021
1f4974c
Delete colouring-maps-9.png
dankelly01 Mar 10, 2021
eefb64a
Add files via upload
dankelly01 Mar 10, 2021
3d60e6a
Update colouring-maps.md
dankelly01 Mar 10, 2021
6a9ff3f
Update colouring-maps.md
dankelly01 Mar 10, 2021
70fa09a
Update colouring-maps.md
dankelly01 Mar 10, 2021
8cc8679
Update minimax.md
dankelly01 Mar 10, 2021
26e4fdb
Update colouring-maps.md
dankelly01 Mar 10, 2021
eb5bcf6
Update minimax.md
dankelly01 Mar 10, 2021
61bcff4
Create bulgarian-solitaire.md
dankelly01 May 5, 2021
a168f05
Create bulgarian-solitaire.md
dankelly01 May 5, 2021
7521163
Add files via upload
dankelly01 May 5, 2021
99412dc
Add files via upload
dankelly01 May 5, 2021
4c83beb
Create where-on-earth.md
dankelly01 May 5, 2021
caf13a7
Create sdt-riddles.md
dankelly01 May 5, 2021
c552328
Create where-on-earth.md
dankelly01 May 5, 2021
f5bc116
Create sdt-riddlds.md
dankelly01 May 5, 2021
d5f9893
Add files via upload
dankelly01 May 5, 2021
3806eb1
Add files via upload
dankelly01 May 5, 2021
9e00dfc
Update bulgarian-solitaire.md
dankelly01 May 5, 2021
1248f86
Rename sdt-riddlds.md to sdt-riddles.md
dankelly01 May 5, 2021
32a4af6
Update sdt-riddles.md
dankelly01 May 5, 2021
e3b3777
Update sdt-riddles.md
dankelly01 May 5, 2021
9c937d1
Update where-on-earth.md
dankelly01 May 5, 2021
b93d784
Update sdt-riddles.md
dankelly01 May 5, 2021
c4692d0
Update where-on-earth.md
dankelly01 May 5, 2021
80ab366
Update bulgarian-solitaire.md
dankelly01 May 5, 2021
0b1a984
Update colouring-maps.md
dankelly01 May 5, 2021
00c96a2
Update minimax.md
dankelly01 May 5, 2021
e6304a8
Update sdt-riddles.md
dankelly01 May 5, 2021
4ce7073
Update where-on-earth.md
dankelly01 May 5, 2021
87d1c7f
add generated translations
chrismclarke May 8, 2021
2822ece
update weekly problems
chrismclarke May 8, 2021
8d8e2c0
update latest translations
chrismclarke May 8, 2021
5c615cf
update weekly problems
chrismclarke May 8, 2021
2f07132
weekly problem update
chrismclarke May 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions maths-club-pack/content/facilitator/colouring-maps.md
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)*
56 changes: 56 additions & 0 deletions maths-club-pack/content/facilitator/minimax.md
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.
22 changes: 22 additions & 0 deletions maths-club-pack/content/student/colouring-maps.md
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
Copy link
Member

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 to 2021-03, just to make sure they take top priority in the app

---

# 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?
Copy link
Member

Choose a reason for hiding this comment

The 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"
(this could be useful in schools were students only have access to paper and pencil, or perhaps a teacher using a chalkboard with only white chalk)

25 changes: 25 additions & 0 deletions maths-club-pack/content/student/minimax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: MiniMax Algorithm
Copy link
Member

Choose a reason for hiding this comment

The 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 MiniMax Algorithm => minimax-algorithm which doesn't match the filename. So please update to just be Minimax (you can still keep the display title in the markdown as Minimax Algorithm, this one is just for metadata extraction)

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?
78 changes: 78 additions & 0 deletions maths-club-pack/cover_images/colouring-maps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions maths-club-pack/cover_images/minimax.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/colouring-maps-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added maths-club-pack/images/minimax-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.