Logicians

my brain hurts

Here is probably the hardest puzzle we’ve looked at so far in maths club …

Two perfect logicians, Sam and Polly, are told that integers x and y have been chosen such that 1 < x < y and x+y < 100.  Sam is given the value x+y and Polly is given the value xy.

They then have the following conversation.

Polly:  I cannot determine the two numbers.

Sam:  I knew that.

Polly:  Now I can determine them.

Sam:  So can I.

Given that the above statements are true, what are the two numbers?

Starting points:

Before Polly and Sam say anything:

What is the range of numbers Sam could be given?

What is the range of numbers Polly could be given?

What special type of number can the product of x and y never be?

What about the square of these numbers?

After Polly’s first statement:

Give two examples of products that Polly can not be given.

After Sam’s first statement:

 Give two examples of sum’s that Sam can not be given.

Next steps …

At this point you probably want to start using a computer to generate a list of numbers that they could be given.

Apples

fresh-apple-250x250

This puzzle comes from Alex Bellos’ column in the Guardian. It has been adapted from one by Prem Prakash, an electrical engineer from Bangalore, India, who has taken early retirement to develop puzzle-based teaching workshops.

You and your two friends Pip and Blossom are captured by an evil gang of logicians. In order to gain your freedom, the gang’s chief, Kurt, sets you this fearsome challenge.

The three of you are put in adjacent cells. In each cell is a quantity of apples. Each of you can count the number of apples in your own cell, but not in anyone else’s. You are told that each cell has at least one apple, and at most nine apples, and no two cells have the same number of apples.

The rules of the challenge are as follows: The three of you will ask Kurt a single question each, which he will answer truthfully ‘Yes’ or ‘No’. Every one hears the questions and the answers. He will free you only if one of you tells him the total number of apples in all the cells.

Pip: Is the total an even number?

Kurt: No.

Blossom: Is the total a prime number?

Kurt: No

You have five apples in your cell. What question will you ask?

See here for the solution.

Origami with maths

hexagon

Today we looked at how we can transform a blank sheet of A4 paper into many different shapes such as an equilateral triangle and a kite. To do so you can either try to figure it out yourself or you can follow the Origami instructions for each different shapes.

If you have anymore interesting ideas please share them in the comment section below and if you want an extra challenge try proving that all of these folds actually give regular shapes bearing in mind the fact that the ratio of the sides in an A4 paper is 1:root 2

Binary Puzzles

binary

This week, we looked at three seemingly unrelated problems which all ended up being related to binary numbers.

The first is about Russian multiplication. Take, for instance 22 x 19.  Multiply the left side by 2 every time and divide the right side by 2, and do this until the right side is equal to 1. If, while you do this, you ever get a decimal number on the right side, round down to the next integer.

e.g.

 22 19
44 9
88 4
176 2
352 1

The next step is to get rid of all the lines with an even number on the right side, which leaves us with 22, 44 and 352 on the left side. Now we know that 22 x 19 = 418. What do you notice when you add 22, 44 and 352? Now try this with other multiplications. Does it still work? If it does, can you explain why it works?

Here is a website that explain this more fully:

https://www.basic-mathematics.com/russian-peasant-multiplication.html

The second problem we looked at today was all about magic cards or maths busking. Have a look at the following cards:

Magic cards

You can do the following trick with them. You ask someone to tell you which colour cards their birthdate appears on. You can straightaway say what their birthdate is. Can you guess how? It is not by learning all the numbers on the cards. One clue is to look at the first number in each card. Can you spot a pattern? Again, here is a website to help you:

http://www.mathmaniacs.org/lessons/01-binary/Magic_Trick/

Extension: If you add one more card, with how many more numbers can you do the trick with?

The final puzzle of today is about poisoned wine bottles. This is the story:

The King of a small country invites 1000 guests to his annual party.

Each guest brings the King a bottle of wine. Soon after, the Queen discovers that one of the guests is trying to assassinate the King by giving him a bottle of poisoned wine. Unfortunately, they do not know which guest, nor which bottle of wine is poisoned.

Just a single drop of the poisoned wine would kill the King.

The King has 10 prisoners in his dungeon. He decides to use them as taste testers to determine which bottle of wine contains the poison.

The poison when taken has no effect on the prisoner until exactly 24 hours later when the infected prisoner suddenly dies. The King needs to determine which bottle of wine is poisoned by tomorrow so that the festivities can continue as planned. Hence he only has time for one round of testing. How can the King administer the wine to the prisoners to ensure that 24 hours from now he is guaranteed to have found the poisoned wine bottle?

As we have seen with a lot of Maths Club problems, sometimes the first step is try with smaller numbers. For instance, instead of using 10 prisoners, we could say that there are 500 prisoners. So how could we test this now? Once you have figured this out, you could try with less and less prisoners. Now, we can solve the puzzle:

First, let’s line up our 10 prisoners and label them. Also label the wine bottles 0–999 so we can tell them apart.

prisoner line up

Label each bottle with both its decimal number and binary equivalent.

decimal=binary
0=0000000000
1=0000000001
2=0000000010
3=0000000011
4=0000000100
5=0000000101
6=0000000110
7=0000000111
8=0000001000
9=0000001001
10=0000001010

etc

Now each bottle serves as a code describing which prisoners are to drink from it. In this system, a one means the prisoner drinks from it, a zero means the prisoner doesn’t.

For example, only Prisoner J should drink from bottle one since its binary is 0000000001. Whereas, Prisoners I and G should drink from bottle ten whose binary is 0000001010 because it has 1’s in the columns that match up with prisoners I and G.

Continue this process until you have given out sips of wine from every bottle. After 24 hours, line up the prisoners in order and note which ones have been poisoned with ones and mark the rest with zeros. Convert this number back into decimal to reveal which bottle was poisoned.

Extension: If there were 2000 bottles, how many prisoners would you need?

If you would like to learn to learn more about binary, check out this website:

https://www.mathsisfun.com/binary-number-system.html

Counting Lattice Paths

counting lattices

This week’s problem is all about counting the number of paths from one point to another on a 4 by 4 grid.

You can only travel in these directions

directions lattice

Here is one acceptable path:

sample path

So how many such paths are there? First off, in which of these ranges do you think the answer lies:

< 20
20 – 40
40 – 60
60 – 80
80 – 100
>100

A first tip on how to solve this is to look at what is going on with smaller grids. Why don’t we start with a 1 by 1 grid? How many different paths are there between the starting point and the end point? Once we have done that, we can place the data on our larger grid.

After doing this a few times, does a pattern start to emerge?

Here is a website that shows all the solutions and an explanation of how the problem works, if you would like to learn more.

http://www.robertdickau.com/lattices.html

River crossing puzzles

wolf

You are on one side of a river, and with you, there is a wolf, a goat and a cabbage. You have one boat, and can only take one living thing at a time. The goat cannot be left alone with the cabbage and the wolf cannot be left alone with the goat. How many journeys must you do in minimum to get all the objects to the other side of the river? In how many different ways can you do it?

Here is a very interesting way to look at the problem which involves representing the problem in 3D wolf/goat/cabbage space.

wolf cube

The problem is then changed to getting from one vertex of the cube to another.

Finally, we looked at another river crossing puzzle, this time involving wildebeest and lions. This puzzle is fully explained and answered in this Ted-Ed talk.

Before looking at how they propose to solve the puzzle, how did you go about solving it?

Benford’s Law

benfordface-e1453738647851

The first task of today was if numbers were chosen at random, what would be the probability that numbers started with the digits 1 to 9. Of course the probability would be the same for each digit.

Ok, let’s see if this works. Go ahead and find any article, it can be a news article, a scientific article, etc. Now count the number of times that each digit 1 to 9 is at the start of a number. Does the distribution seem even?

Let’s see if this trend can be found in mathematical sequences too. Here’s an example: the Fibonacci sequence.

1,1,2,3,5,8, …

Let’s find the probability of numbers starting with digits 1 to 9 in the first 10,000 numbers of this sequence.

Quick tip: you can use excel to do this and then use the countif function to find the distribution of probabilities of numbers that start with each digit. Does the distribution seem even?

Excel first digit

Excel countif

This strange pattern of occurrence is called Benford’s law, and it is very counter-intuitive.

benford graph

If you would like to learn more, click on this link: https://brilliant.org/wiki/benfords-law/

So here is your final challenge: every single time you see a number today, write it down and you can then verify the law for yourself. How close did you get?

Mastermind problems

mastemind

Welcome back to Maths Club!

Today, we looked at a few logic problems based on the popular game, Mastermind. If you have never played it before, you can try online here.

We then answered these interesting questions  about what you can deduce from certain opening moves.

For the answers to these questions and some of the mind bending maths behind Mastermind, have a look at this paper by Tom Davis.

Voting systems

voting

Finding betting ways to vote

We looked at different ways to decide which candidate or choice won a vote. We realised that by using different methods, different candidates won the vote. This raises the troubling question about whether our way of voting is the best and the fairest. Here is a link to the activity we did and here is a link to an interactive website that discuss precisely this question. In the UK, the voting system is relative majority. However, it could be a good thing if we use absolute majority voting, because it would allow members of smaller parties to also get a voice. This could lead to a bigger number of parties rather than two or three major parties. However, there is no perfect voting system.

Gabriel’s problem

Gabriel box

Gabriel wrote the numbers 1-9 in a 3×3 grid.

He then multiplied together all the numbers in each row and wrote the resulting product next to that row.
He also multiplied the numbers in each
column together, and wrote the product
under that column.
He then rubbed out the numbers 1-9.

Can you work out where Gabriel placed the numbers 1-9?

Did you have more information than you needed?

This puzzle comes directly from this NRich page, with the pdf of the problem available here.

Parable of the Polygons

polygons

Today we looked at this “playable post on the nature of society”. It is a great activity to make you think about how you can positively contribute to society becoming less segregated.

We tried to work out the maths behind the applet. Where does 95% come from in the screenshot from above?? In the javascript for the applet you can see that a measure of “sameness” is used which involves the fraction of neighbours that are the same as you. Can you create/recreate the algorithm used to find the 95%?

91 card game

 

cardsfor91

91 card game

This card game can be played with two or more players. The goal of the game is to collect the most number of points possible. You do this by biding on the diamonds, using your cards.

The game starts with each player having one complete suit, for instance, one player could have the spades. You can use more than one pack if there are more than three players.

The diamonds are mixed up and placed in the middle. These diamonds are turned over one by one and each player throws a card depending on the value of the diamond card. The values for each card are as follows:

King – 13   Queen – 12   Jack – 11 and the rest of the cards follow as such, Ace being worth 1 point.

The player who’s card has the highest value collects the diamond card. In the picture above, the person who played the King of Clubs would win the Jack of Diamonds.

If there is a tie and two or more people play cards of the same value, then another diamond is added to the middle and all the players bid again for these cards. If the final card played by each player is a tie then no one wins the diamonds in the middle.

The player who wins is the player who collects the most points out of the 91 available after all cards have been played.

Can you find a winning strategy to be able to collect the most points every time?

Taxicab geometry

Taxicab geometry is a form of geometry, where the distance between two points A and B is not the length of the line segment AB but the sum of the shortest horizontal and vertical distances between the two points. Example:

Length

The first challenge is to try to find what a midpoint would be in taxicab geometry. Here is an example to help:

midpointexample

Since the distance between A to the midpoint is the same as the distance between the point B and the midpoint, the midpoint is at the same distance from A and B. Can you spot any more midpoints, if there are any? Can you pick two different points that do not have a midpoint?

The second task is to find what a perpendicular bisector looks like on taxicab geometry.

The third task is to try to draw a circle in the taxicab geometry.

Next, try to draw an equilateral triangle and a rhombus.

If you can do all that, try to draw other geometrical shapes you know on taxicab geometry and post them in the comments.

For more info have a look here.

The second challenge – The Two Eggs Problem

two eggs

You are given two eggs, and access to a 100-storey building. Both eggs are identical. The aim is to find out the highest floor from which an egg will not break when dropped out of a window from that floor. If an egg is dropped and does not break, it is undamaged and can be dropped again. However, once an egg is broken, that’s it for that egg.

If an egg breaks when dropped from floor n, then it would also have broken from any floor above that. If an egg survives a fall, then it will survive any fall shorter than that.

The question is: What strategy should you adopt to minimize the number egg drops it takes to find the solution? (And what is the worst case for the number of drops it will take?)

Alphanumerics

send
The above is probably the most famous example of an alphametric.

A cryptarithm is a type of mathematical puzzle in which the digits in numerical calculations are replaced by letters of the alphabet.

Alphametics are cryptarithms in which letters form meaningful words, often in meaningful phrases. There are only a few simple rules for these puzzles:

1. The same letter always stands for the same digit, and the same digit is always represented by the same letter. So if a P stands for a 2, every P in the puzzle is a 2. If a 3 is represented by a K, every 3 in the puzzle will be a K.

2.The digit zero is not allowed to appear as the left-most digit in any of the numbers in the puzzle. For example, if the word FOOD represents an addend in a puzzle, the F may not be a zero.

3.Most alphametics have unique solutions (there is only one possible answer).

Here are a few easier alphametrics to try to solve. You need to find which letter each number represents. A good place to start in the first one is the F of FOOL, as there is only one number it can possibly be:
alphanumerics
Here is an extensive list to try from Bielefeld University.
You can even make up your own ones here!
For example
FlemingGoodman
But there is no guarantee that they will be easy or fun to solve! It may take a lot of brute force.
Finally this is a puzzle from Nrich about an alphanumeric that doesn’t have a unique solution:
kids

Well done on the first challenge

Thank you everyone for your excellent contributions. Well done trying by hand and I hope some of you had a look at trying different numbers on the geogebra applet here.

It seems like finding a long sequence really is a challenge no matter what numbers you use.

However ….

It is technically possible to choose four numbers that make an infinite sequence where you never end up at 0,0,0,0. The solution is very tricky to work with though and using a computer doesn’t even help because computers round numbers to a certain number of decimal places which messes up the result.

For an explanation and how to get to the solution have a look at this blog.

The next official challenge will be launched on Wednesday 19th of April … please enjoy the other puzzles on this site in the meantime.

Estimating Pi for Pi Day!

circle dartboard

As it was Pi Day on Tuesday (14th of March is 3.14 in American style date!) we thought we would try and estimate the value of Pi by simulating throwing darts randomly at a square dartboard like below and seeing how many land inside the circle.

One way to do this is to generate a random point by typing the following in the input bar.

(RandomUniform[-1, 1], RandomUniform[-1, 1])

This will generate a point with x coordinate inbetween -1 and 1 and y coordinate inbetween -1 and 1.

Then right click on the point and select “Trace On”.

In the View menu there is a command called “Recompute All Objects”. The shortcut for this is to hold down Ctrl and press R.

You should see your random point going to different places in the screen. You can do this say 80 times.

Alternatively, you can create 80 points on a spreadsheet with the Random Uniform command and then “Create List of Points”. See here for a working applet with this method.

Either way you can now estimate the value of Pi!!!

Count the number of points inside the circle
Divide this by 80 to get the proportion of points that are inside the circle.
Area of the circle is π * 1² = π
Area of square is 2*2=4
So this proportion should be π/4.
So if we multiply our proportion by 4 we get an estimate for π.

The more points you use the better the estimate will be.

Good luck, and happy Pi Day!

Collatz conjecture

collatz

Think of an positive integer.

If it is equal to 1, stop.

If it is even, divide it by 2.

If it is odd, multiply it by 3 and add 1.

With the new number you get, repeat the instructions above.

If you picked the number 6, your sequence would look like this:

3, 10, 5, 16, 8, 4, 2, 1

Did your sequence end up at 1? Mathematicians have guessed (hypothesised) that all starting choices will eventually end up at 1, but no one has been able to prove this. If you can find just one example that disproves this theory then you could claim a prize of 120 million Japenese Yen!  Here is a fun example of a counterexample that took a long time to find.

Try a few starting numbers by hand. Then you could try and use the power of a spreadsheet such as Geogebra, or by writing some code on Python and let the computer do the hard work for you!

Open up Geogebra.

You will need to use the Mod  command:

Mod[ <Dividend Number>, <Divisor Number> ]

to check if the number is even.

and the If command:

If[ <Condition>, <Then>, <Else> ]

to choose what to do if it is even and what to do if it is odd.

Put together, here is the formula you should put into cell A2, once you have put a starting number in A1.

=If[Mod[A1, 2] == 0, A1 / 2, A1*3 + 1]

Then just hover your mouse pointer in the bottom right corner and click the left button and hold down and drag down lots of cells. You should see the sequence appear.

If you want to be super clever you could try and combine two If statements so that if the cell was equal to 1 it would stop calculating and just say “STOP”.

You could also try this activity on Python, click on the menu bar on the top left to make it full screen.


Good luck!

First challenge – squares in squares puzzle

Deadline – 22nd of March!

Draw a square and choose four numbers to put at each vertex. For example:

diffy1

Now in the middle of each segment write the positive difference between the two numbers at each end. e.g. the difference between 5 and 6 is 1.

diffy3

Join these new points up with a square

diffy4

Now in the middle of each segment of the new square find the positive difference of the numbers at each end. For example the difference between 15 and 1 is 14. Do this for all the segments and draw another square joining up your four new answers.

diffy5

Keep finding the positive differences and joining these points up into a square until you reach 0,0,0,0.

diffy6

Choose four new starting numbers and follow the instructions above to create your own version of this.

Our first choice of four starting numbers meant drawing 4 squares before we reached 0,0,0,0. How many squares have you drawn with your choice of starting numbers?

Your challenge is now to find the longest sequence of squares you can before the sequence reaches 0,0,0,0 and send us your answer.

An easy way to send sequences would be as lists of numbers. For example the one above could be written as

diffy7

Please write giving us your longest sequence and any other thoughts on the puzzle using the “Leave a comment” button below.

 

Dobble!

dobble card

We started off by playing the card game Dobble. If you haven’t seen it before, the game consists of a set of cards like the one above with 8 symbols on each card. You compete in a small group of people to be the first to spot a common symbol with your topmost card and a card in the middle.

The question is, what is the maximum number of cards you could have in the Dobble pack so that there is always exactly one identical symbol between any two given cards, and this identical symbol is not the same for all the cards (that would be a boring game!).

This is a hard question to answer straight away, try first to create a “Dobble” set of cards with just 2 symbols per card.

Then try and create a set with 3 symbols per card.

Any patterns you spot should help you to answer the hard question!

Here is a nice blog on the maths behind Dobble.

Cribbage

cribbage4

Cribbage

We played a simplified version of Cribbage, and looked at some of the interesting maths behind it.

Rules

Game for up to 8 players. Each person is dealt six cards. Players choose four cards to keep. Then one card is turned up in the centre of the table and counts as part of each player’s hand. Ace is considered the low card, and king high. The scoring is as follows:

Fifteens. Each card is assigned a value. Ace through 10 are the face value of the card, and jack, queen and king have value 10. Each combination that totals fifteen is awarded 2 points.

Pairs. Each pair of cards, ace through king, is awarded 2 points.

Runs. Each run of three or more cards is awarded the number of points equal to the length of the run – a run of three is worth 3 points, a run of four, 4 points, and a run of five, 5 points. In this instance runs are not counted in multiple ways. For example, A ,2, 3, 4, 5 is not counted as one run of five, two runs of four and three runs of three, but only as a single run of five.

The person with the highest score after four rounds is the winner.

Example hand (scores 16 points)

cribbage3

Questions to think about:

What do you think is the minimum and maximum scores possible?

Can you find the maximum hand?

Are there any impossible numbers inbetween?

Are some points totals more common than others?  How could we know for sure?

See this page for some of the answers to these questions.

Here are the full version rules of Cribbage

Quadrilaterals

9 pin board

Find all the different quadrilaterals you can make by joining four dots on a 9-dot grid.

Different in this case means not congruent – i.e. none of your quadrilaterals should be able to be formed by rotating, translating or reflecting one of your other quadrilaterals.

Here is a couple to get you started:

quadrilaterals

How many can you find?