Assignment
Assignment
To be discussed in Tutorials:
1
Figure 1: Instructions for drawing
• The same order of the pegs has to be maintained after moving them.
• Only one disk has to be moved at a time.
• No large disk can be placed on a smaller one.
A simple version of the towers of Hanoi consists of three disks instead of eight. In plain simple
English write a set of steps by which you can move the three disks from one peg to the other.
https://www.mathsisfun.com/games/towerofhanoi.html
• Each area marked out by darker lines must contain the numbers from 1 up to the number
of squares in the area. For example, the top most area in the first puzzle below consists of 5
squares so those squares must be filled with the numbers: 1, 2, 3, 4 and 5 with no repeated
numbers. If the area has two squares, like the one bottom left below, then it must be filled
with the numbers 1 and 2.
• No number can be next to the same number in any direction, whether horizontally, vertically
or diagonally. So in the grid below, the fact that there is a 4 on the side means there cannot
be a 4 in any of the 5 squares surrounding it.
2
Figure 2: Cut Block
a) Start by trying to find the smallest the number of weighings for 4 balls, knowing that the
odd ball is heavier than the rest. What could be the number weighings for 8 balls?.
b) What will happen if you know that the odd ball is just different i.e could be heavier or
lighter?
What could be the number weighings for 4 balls? Can you do it for 6, what about 8, what
about 13?
To be solved in Labs:
https://studio.code.org/hoc/1
https://hoc.nclab.com/karel/
Extra Exercises:
There are 3 crates in front of you. One crate contains only apples. One crate contains only oranges.
The other crate contains both apples and oranges. And each crate is labeled. One reads "apples",
one reads "oranges", and one reads "apples and oranges".
3
But the labeling machine has gone crazy and is now labeling all boxes incorrectly.
If you can only take out and look at just one of the pieces of fruit from just one of the crates, how
can you label ALL of the crates correctly?
On one particular day she buys a new hen and a sack of corn. Returning home later in the day she
arrives back at the ravine, and quickly realises she has a problem. She can only carry one thing
across with her as she crosses using the seat. She will have to make several trips. The trouble is,
if she leaves the hen and the corn alone on either side, the hen will eat the corn. Similarly if she
leaves Mist and the hen together on one side the dog will worry the hen and may mean it stops
laying eggs. Mist doesn’t eat corn so it will come to no harm if left with him.
Write down the series of steps that she must take to get everything across so she can continue on
her way.