Fractals

Exploring the Koch Snowflake (it’s getting cold after all!)

Draw the biggest equilateral triangle you can on a page

On each line/side, cut it in three parts and remove the middle part

Add two sides of a triangle in the gap.

Repeat like so:

362px-KochFlake.svg

What develops is a fractal. If you carry on this pattern for ever the area is bounded but the perimeter is infinite! You can learn how to make the Koch snowflake on Python here.

This site gives the code for a Seirpinski Triangle. You can try it on Trinket here.

Numberphile have an amazing collection of maths videos, one relating to fractals is here. And here is a great TED talk by Benoit Mandelbrot.

Logo Programming

logo2

Logo is a language that was written in 1967, but is still interesting to work with nearly 50 years later!

There is an online version to use or Windows users can download a free copy of FMSlogo. A good free version for Mac users is ACSlogo.

THe basic LOGO commands are:

FD forward          BK backward

LT left                    RT right

PU pen up             PD pen down

HT hide turtle      ST show turtle

CS clear screen    CT clear text

The following challenges are adapted from the brilliant monthly puzzle website NRich, try the full set of puzzles after.

Challenge 1

Try drawing these shape on LOGO

starsquare-5

Challenge 2

Draw regular polygons just by using the repeat command.

e.g.  REPEAT 5 [FD 30 RT 72]

Challenge 3

Now trying using nested repeats to create shapes like this!

logo1logo2logo3

Killer Sudoku

Today we looked at strategies for solving a tricky version of a popular puzzle. Usual Sudoku rules apply – numbers 1 to 9 in every row, column and box – but in this version you don’t get any starting numbers, just the total sum of the numbers in each dotted box.

sudoku

Hint: The numbers 1-9 add up to 45, see if you can use that fact and the bottom left square to calculate this number (see how one of the dotted boxes overlaps the squares):

sudoku4

12 + 7 + 16 = 35.  This helps a lot!

Hat puzzles

768.png

Hat puzzles provide endless entertainment! The following ones which accompany the picture above are taken directly this week’s Monday puzzle in the guardian by Alex Bellos , which is an excellent source of maths puzzles.

Alice, Bob and Charlie are well-known expert logicians; they always tell the truth. They are sat in a row, as illustrated above. In each of the scenarios below, their father puts a red or blue hat on each of their heads. Alice can see Bob’s and Charlie’s hats, but not her own; Bob can see only Charlie’s hat; Charlie can see none of the hats. All three of them are aware of this arrangement.

(i) Their father puts a hat on each of their heads and says: “Each of your hats is either red or blue. At least one of you has a red hat.” Alice then says “I know the colour of my hat.” What colour is each person’s hat?

(ii) Their father puts a new hat on each of their heads and again says: “Each of your hats is either red or blue. At least one of you has a red hat.” Alice then says “I don’t know the colour of my hat.” Bob then says “I don’t know the colour of my hat.” What colour is Charlie’s hat?

(iii) Their father puts a new hat on each of their heads and says: “Each of your hats is either red or blue. At least one of you has a red hat, and at least one of you has a blue hat.” Alice says “I know the colour of my hat.” Bob then says “Mine is red.” What colour is each person’s hat?

(iv) Their father puts a new hat on each of their heads and says: “Each of your hats is either red or blue. At least one of you has a red hat, and at least one of you has a blue hat.” Alice then says “I don’t know the colour of my hat.” Bob then says “My hat is red”. What colour is Charlie’s hat?

(v) Their father puts a new hat on each of their heads and says: “Each of your hats is either red or blue. Two of you who are seated adjacently both have red hats.” Alice then says “I don’t know the colour of my hat.” What colour is Charlie’s hat?

Answers can be found here

Another great puzzle is:

Four prisoners are arrested for a crime, but the jail is full and the jailer has nowhere to put them. He eventually comes up with the solution of giving them a puzzle so if they succeed they can go free but if they fail they are executed.

The jailer seats three of the men into a line. The fourth man is put behind a screen (or in a separate room). He gives all four men party hats. The jailer explains that there are two black hats and two white hats, that each prisoner is wearing one of the hats, and that each of the prisoners see only the hats in front of him but neither on himself nor behind him. The fourth man behind the screen can’t see or be seen by any other prisoner. No communication among the prisoners is allowed.

If any prisoner can figure out what color hat he has on his own head with 100% certainty (without guessing) and tell the jailer, all four prisoners go free. If any prisoner suggests an incorrect answer, all four prisoners are executed. The puzzle is to find how the prisoners can escape, regardless of how the jailer distributes the hats.

Answer is here.

And finally the super tricky one:

100 prisoners are lined up by an executioner, who places a red or blue hat upon each of their heads.

The prisoners can see the hats of the people lined up in from of them, but they cannot look at the hats behind them, or at their own.

Starting at the back of the line, the executioner asks the last prisoner to state the colour of his hat.

In order to live, the prisoner must answer correctly.

The night before the line-up, the prisoners can discuss a strategy to help them survive. How many prisoners can be guaranteed to be saved?

See here for a discussion of the solution.

Project Euler

euler_portrait

The puzzle that we solved this week can be solved by hand, but excel is a very useful tool!

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

This puzzle was taken from  Project Euler Website, where there are lots more puzzles to try, all designed to be solved with a computer.

Magic tricks

cards
See if you can be the magician …

Deal three piles of three cards. Ask someone to choose a pile and look at the bottom card without showing you the card. Put the three piles together, with the chosen pile on top.

Then count off cards while spelling some words such as “Thomas is clever”. The first word should have at least three letters and a maximum of nine letters, the second word should have two letters, and the third word should have at least five letters and a maximum of nine letters.

For each word, deal the top cards in the deck onto a separate pile, and then put the dealt cards back under the bottom of the deck before proceeding to the next word.

Finally, spell out the word ‘MAGIC’; the chosen card will be the card at ‘C’ – so you can flip this card over and amaze your audience!

This trick also works if you look at the card that is chosen at the start, and then spell it out e.g. TWO OF SPADES MAGIC.

Why does it always work?