96_Maths_Y5_Nim

Page 1

Supporting the effective use of ICT across the primary curriculum

www.ictopus.org.uk contact@ictopus.org.uk

Mathematics Ages 9 - 10: Nim Introduction: This lesson combines an understanding of number systems, with problem solving and strategy formulation. Children are taught the game of Nim which they can play against each other or against the computer. They will then investigate a strategy to ensure that they can win each time. Resources • One computer per two children for group work, or one computer and a data projector for whole class work • Children may need paper and pencil to help them with their calculations. Some children may need help converting from binary to decimal. A ‘converter’ can be found at: http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Previous learning Children will need the ability to carry out simple arithmetic calculations and to recognise odd and even numbers. They will need the ability to apply a set of rules to a problem. Learning Objectives • To understand the principles of the binary system • To be able to convert denary (decimal) numbers to binary and vice versa • To develop a strategy for solving the game of Nim What to do This lesson is in three parts (although it may take more than one lesson to complete) Stage 1 The rules of the game of Nim can be found at: http://www.robtex.com/frames.htm#http://www.robtex.com/robban/nim1.htm There are several versions of the game so we are using the basic version in this lesson. In essence a player can take as many matches as they wish from any one of the three rows (in fact the number of rows is arbitrary). The winner is the player who takes the last match of the game. Let the children try this game several times but encourage them to note down their moves so that it is possible to ‘replay’ a game. The website above allows the children to play Nim against the computer. Play the ‘normal’ rules, which means that the player to take the last match is the one to win. Note that if you wish to remove 4 matches from a particular row then you click on the left hand of the four matches and all of those to the right will be removed. Stage 2 Explain to the children about the binary system. The two key points are that it only uses the digits 1 and 0 and that the place values are as shown below: Place value Binary number

32 1

16 0

8 1

4 1

2 0

1 1

Hence this number, in base 10, is 1 x 32 +1 x 8 + 1 x 4 + 1 x 1 = 45 In the reverse process, for example converting 23 into binary, the children would fill the boxes with a 1 or 0 so that they would get 23 if they applied the calculation above.

© ictopus ltd

lessons2go

Maths Ages 9 - 10: Nim 2010


Stage 3 What connects these two activities? – the strategy for winning! Let’s assume that the child is playing a naïve teacher. When it is the child’s turn they must make a move such that they: • Convert the number of matches in each row to binary numbers • Add up the total in base 10 • Make their move such that, after making it, each digit of the answer must be even (not the overall total but each individual digit) • If they can achieve this, then they remain in a winning position. For example, suppose it is the child’s go and the position they are facing is this one: 7 5 6 Total

111 101 110 312

The child then decides to take 4 from row 1, leaving: 3 5 6 Total

11 101 110 222

As every digit is now an even number, the child is in a winning position and the teacher can’t make a move that puts him/her into a winning position. Deciding how many to take from which row will take some children quite a time (because of the need to check their arithmetic). Hence they should not be put under time pressures. The secret to success is to decide who plays first. It will depend upon the initial layout of the matches. If the sum of the digits is even, then ask the opponent to play first. If one of them is odd, then make sure that you play first. In the on-line version listed above the user is always the first to play but the number of initial matches in each pile is such that the user starts off in a winning position. For example, initially the three piles were 8, 11 and 10 matches. If these are converted to binary and added up, the total is 3021 (i.e. one or more digits is odd). If 9 matches were removed from pile 2, the resulting piles would be 8, 2 and 10 matches. Convert these to binary and add would give a total of 2020 (all even digits and hence a winning position). Differentiation For less able children it might be necessary to give them a conversion table from denary to binary so that they only have to look up the conversion rather than work it out for themselves. The game can be made easier, or more difficult, by varying the number of rows and the maximum number of matches in each row The role of ICT If two children are playing against each other then it isn’t necessary to use ICT. However, by using the web sites above, they can check that their conversions from denary to binary are accurate. However, there is more satisfaction in playing the computer. Bear in mind that if the computer steals the initiative, then it will win. Hence the strategy has to be accurate on every go. In some versions of Nim, the computer responds so quickly that it isn’t possible to see what it has done. In the version given above the computer does state what move it has made and hence it is easier to follow the game. Follow-up suggestions There are a number of ways of extending this problem. The NRich web site shows a number of variations of the game of Nim. http://nrich.maths.org/4820 Alternatively, children could be given the ASCII code (for the upper case alphabet only plus the code for a space) and can send coded messages to each other in binary. There are many web sites that give the conversion set. http://www.ascii-code.com/ Assessment The children should consider the difference between a random approach (how often did they win?) and an approach based around a systematic method. Which part of the game did they find the hardest? What happened if they made a mistake – could they retrieve the situation on a subsequent move? Does the computer ever make a false move, and, if not, why? © ictopus ltd

lessons2go

Maths Ages 9 - 10: Nim 2010


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.