<?xml version="1.0" encoding="UTF-8" ?>
  <resource>
  <id>7482</id>
  <path>/www/nrich/html/content/id/7482/</path>
  <resourceTypeID>1</resourceTypeID>
  <last_published>2011-12-20T10:16:33</last_published>
  <indexXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;Agent X is a secret agent in the field. She needs to transmit enemy movements back to base. Her opportunities to send messages are limited so she has to transmit the data as accurately and efficiently as possible.&lt;/p&gt;
&lt;p&gt;To transmit the compass direction of the enemy movements, she uses this diagram:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;mdo:image src=&quot;Secret.png&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;
&lt;p&gt;Agent X sent the message 0010 because the enemy were travelling North-East. Unfortunately one of the digits was altered in transmission so her base camp received the message 1010, South-West, instead! &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before reading on, you may wish to think of ways of sending extra information to try to get the message through even if a digit might get altered.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;One method of sending communications is to include an extra &amp;quot;check&amp;quot; digit.&lt;/p&gt;
&lt;p&gt;Agent X decides to send one extra digit on the end so that the message always contains an even number of 1s. She claims that if at most one digit is incorrect (which could be the check digit), it is always possible for her team to tell if the message is correct or not. &lt;strong&gt;Is she right?&lt;/strong&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Here are the messages she sends. Which ones are error-free?&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;br&gt;&lt;/br&gt;
&lt;mdo:image src=&quot;oldpaper3.png&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For each message containing an error, how many different starting messages could Agent X have sent?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With a single check digit, the agents know when there is a mistake but can&amp;#39;t work out what the original message should be, so Agent X decides to introduce some more check digits so that her team can recreate her message even if there is an error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you would like to try creating a system of check digits, have a go now before reading the hidden text below to see what Agent X did. You can assume that there will be at most one error.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class=&quot;toggle&quot;&gt;
&lt;p&gt;Agent X wants to send the message abcd, where each letter represents 0 or 1. &lt;/p&gt;
&lt;p&gt;She works out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a check digit x (either 0 or 1) so there are an even number of 1s in &lt;strong&gt;xabd&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;a check digit y (either 0 or 1) so there are an even number of 1s in &lt;strong&gt;yacd&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;a check digit z (either 0 or 1) so there are an even number of 1s in &lt;strong&gt;zbcd&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Agent X then transmits the message &lt;strong&gt;xyazbcd&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For example, if Agent X wants to send 0110, she calculates that x= 1, y=1 and z=0. She then transmits 1100110. &lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;strong&gt;If you receive Agent X&amp;#39;s message, how can you check whether there is an error?&lt;br&gt;&lt;/br&gt;
I&lt;/strong&gt;&lt;strong&gt;f you find that there is an error, is&lt;/strong&gt; &lt;strong&gt;it possible to recreate the original message?&lt;/strong&gt;&lt;br&gt;&lt;/br&gt;
 &lt;/p&gt;
&lt;p&gt;Read the hidden text to find out how the agents back at base check and correct Agent X&amp;#39;s messages.&lt;br&gt;&lt;/br&gt;
 &lt;/p&gt;
&lt;div class=&quot;toggle&quot;&gt;
&lt;p&gt;The base camp can check whether the message they receive has been transmitted correctly by counting the number of 1s in xabd, yacd and zbcd.&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
If these are all even numbers, the message has been transmitted correctly, and they can read off the message Agent X sent by reading the 3rd, 5th, 6th and 7th digits. &lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
If one or more of these strings xabd, yacd, zbcd contains an odd number of 1s, the base camp can work out which digit has been altered in transmission.&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;strong&gt;For example&lt;/strong&gt;, suppose b has been altered in transmission:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;strong&gt;xabd&lt;/strong&gt; and &lt;strong&gt;zbcd&lt;/strong&gt; will contain an odd number of 1s.&lt;br&gt;&lt;/br&gt;
The fact that &lt;strong&gt;yacd&lt;/strong&gt; has an even number of 1s in it means y, a, c and d must have been transmitted correctly.&lt;br&gt;&lt;/br&gt;
The only digit that is in both xabd and zbcd, but not in yacd, is b, so they can deduce that b is the incorrect digit.&lt;br&gt;&lt;/br&gt;
They can then correct the error and read off the message Agent X transmitted.&lt;/p&gt;
&lt;br&gt;&lt;/br&gt;
&lt;strong&gt;Another example&lt;/strong&gt;: suppose base camp receives the message 0100111.
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;width: 313px; height: 65px&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;x&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;y&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;a&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;z&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;b&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;c&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;d&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;0&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;0&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;0&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;xabd: Even&lt;br&gt;&lt;/br&gt;
yacd: Odd&lt;br&gt;&lt;/br&gt;
zbcd: Odd&lt;/p&gt;
&lt;p&gt;This means that x, a, b and d are all correct, one of y, a, c and d is incorrect, and one of z, b, c and d is incorrect. The digits that appear in both yacd and zbcd are c and d, but we know d is correct, so c must be the incorrect digit. So the message should have read 0100101, so Agent X sent 0101, or North-North-West.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Here are the messages that Agent X sent using the new system. Again, you can assume that there is at most one altered digit.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;mdo:image src=&quot;oldpaper2.png&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Which ones have been transmitted error-free?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can you correct the incorrect messages?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is it always possible to correct a message that contains an error?&lt;br&gt;&lt;/br&gt;
How do you know?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You can follow up these ideas in the problem &lt;a href=&quot;/7206&quot;&gt;More Secret Transmissions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class=&quot;framework&quot;&gt;&lt;strong&gt;Notes and Background&lt;/strong&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Error detection and correction is an important part of Information Theory. You can read more about some of the ideas explored in this problem in this &lt;a href=&quot;http://en.wikipedia.org/wiki/Forward_error_correction&quot;&gt;Wikipedia&lt;/a&gt; article.&lt;/div&gt;&lt;/mdoxml&gt;</indexXML>
  <solutionXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;&lt;span class=&quot;editorial&quot;&gt;Donald, from Verulam, had a good idea to try to ensure the message went through uncorrupted:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Repeat the original message after the true message and the check digit. For example, if 1110 is the original, and 11101 is the original and check, then 111011110 is the original and check and original again. Transmit this message. We can split this up, 1110 1 1110. If each number is changed, e.g. 1111 1 1110, then we look at the 1st original message &amp;#39;1111&amp;#39; and the
2nd original message &amp;#39;1110&amp;#39;. If they are the same, then this is probably the correct message. If not, then look at the check digit.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;editorial&quot;&gt;We&amp;#39;ve added this to our &amp;#39;Toughnuts&amp;#39; to see if anyone can solve the rest of the problem. Can you be the first?&lt;/span&gt;&lt;/p&gt;&lt;/mdoxml&gt;</solutionXML>
  <noteXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;
&lt;h3&gt;&lt;strong&gt;Why do this problem?&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;This problem introduces the important idea of error detection and correction from the field of Information Theory, which has applications in Computer Science.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Possible approach&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Begin&lt;/strong&gt; by introducing the compass wheel and explaining the problem:&lt;br&gt;&lt;/br&gt;
&amp;quot;Agent X needs to transmit that the enemy were travelling North East, but she knows that one of the digits might be flipped in transmission, from a 1 to a 0, or vice versa. Talk to your partner and see whether you can come up with any ways she could send her base camp some extra information to ensure the message gets through.&amp;quot;&lt;/p&gt;
&lt;p&gt;Possible suggestions that might emerge are sending the message multiple times, or perhaps sending a check digit.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Then&lt;/strong&gt; introduce the idea of check digits:&lt;/p&gt;
&lt;p&gt;&amp;quot;Agent X decides to add one extra digit to the end so that the message always contains an even number of 1s. She claims that if at most one digit is incorrect (which could be the check digit), it is always possible for her team to tell if the message is correct or not. Is she right?&amp;quot;&lt;/p&gt;
&lt;p&gt;Allow some time for discussion. Then give students the following nine messages with check digits and ask them to work out which are error-free, and how many different possible starting messages there are for those which include an error:&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;mdo:image src=&quot;oldpaper3.png&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next&lt;/strong&gt;, hand out &lt;a href=&quot;/content/id/7482/Secret%20Transmissions.pdf&quot;&gt;this worksheet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;quot;A single check digit can only tell us if there has been an error, but not what the error is. Here is a system of three check digits that Agent X claims can be used to detect AND correct an error in her message, as long as there is no more than one.&amp;quot;&lt;/p&gt;
&lt;p&gt;Give students time to make sense of the check digit system in small groups and to have a go at recreating the correct messages for the four transmissions on the sheet.&lt;/p&gt;
&lt;p&gt;&amp;quot;Decide on a direction to send, and work out the three check digits. Then swap with your partner, after making a change to one of the seven digits. Can they work out what your message should say?&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Finally&lt;/strong&gt;, allow some time to discuss how and why the check digit system allows error detection AND correction for any message with at most one error. The &lt;a href=&quot;/7482/clue&quot;&gt;hint&lt;/a&gt; shows a diagram that may help students to make sense of how the check digits interact.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Key questions&lt;/h3&gt;
&lt;p&gt;If digit a is changed from a 1 to a 0, what is the effect on xabd, yacd, and zbcd?&lt;br&gt;&lt;/br&gt;
What if digit b, c or d is changed?&lt;br&gt;&lt;/br&gt;
What if digit x, y or z is changed?&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
 &lt;/p&gt;
&lt;h3&gt;Possible extension&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/7206&quot;&gt;More Secret Transmissions&lt;/a&gt; invites students to consider an error detection and correction system for longer strings of binary digits.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Possible support&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/content/id/7482/Secret%20Transmissions%20Support.pdf&quot;&gt;This worksheet&lt;/a&gt; contains a couple of examples showing how Agent X's code works.&lt;/p&gt;
&lt;p&gt;For a simpler introduction to the ideas of error detection, see &lt;a href=&quot;/702&quot;&gt;Book Codes&lt;/a&gt; which looks at ISBN codes.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</noteXML>
  <clueXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;This Venn diagram shows the relationship between the check bits and the message bits. We can use this to work out which digit has been altered. Suppose we find that yacd and zbcd contain an odd number of 1s, and xabd contains an even number of 1s. We look at the intersection of y, z and not-x (any region that x isn&amp;#39;t in), which is c. This therefore tells us that c has
been altered in transmission. &lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;mdo:image src=&quot;Hamming%287%2C4%29.png&quot; style=&quot;width: 300px; height: 278px;&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt; &lt;/p&gt;&lt;/mdoxml&gt;</clueXML>
  <canonXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;Besides the two methods mentioned in the problem, another method of making sure the message can be understood includes sending each bit three times and taking the value to be the digit which occurs most, i.e., we&amp;#39;d interpret 111, 011, 101, 110 as 1, and 000, 100, 010, 001 as 0. Using this method means we can cope with one bit altering during transmission, but is less efficient than the 3
check digit method as the message is only 1/3 of the bits sent. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1 check digit:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The messages 01110, 10101, 01000, 11111 and 10011 contain errors as they all have an odd number of 1s. &lt;/p&gt;
&lt;p&gt;For each message, there are 5 possible messages with an even number of 1s they could have originally been! For example, the first message may have been originally 11110, 00110, 01010, 01100 or 01111.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3 check digits:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;i) Received message: 1010101&lt;/p&gt;
&lt;p&gt;xabd = 1111, yacd = 0101, zbcd = 0101. These all contain an even number of 1s, so the message has been transmitted correctly. The message sent by Fred was therefore 1101.&lt;/p&gt;
&lt;p&gt;ii) Received message: 0001111&lt;/p&gt;
&lt;p&gt;xabd = 0011, yacd = 0011, zbcd = 1111. These all contain an even number of 1s, so the message has been transmitted correctly. The message sent by Fred was therefore 0111. &lt;/p&gt;
&lt;p&gt;iii) Received message: 0010011&lt;/p&gt;
&lt;p&gt;xabd = 0101, yacd = 0111, zbcd = 0011. xabd and zbcd contain an even number of 1s, but yacd doesn&amp;#39;t. Using the Venn diagram, looking at the intersection of y, not-x and not-z, we find that the digit y has been altered during transmission, so the message should be changed to 0110011, which means the message Fred sent was 1011. &lt;/p&gt;
&lt;p&gt;iv) Received message: 1110100&lt;/p&gt;
&lt;p&gt;xabd = 1110, yacd = 1100, zbcd = 0100. yacd contains an even number of 1s, but xabd and zbcd contain an odd number. The two digits that appear in both of these are b and d. However, we know all the digits in yacd are correct, which means it must be b that&amp;#39;s been altered in transmission. Alternatively, we could look at the intersection of x,z and not-y in the Venn diagram, which is b.
Therefore, the message should be changed to 1110000, which means the message sent by Fred was 1000. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This method which uses three check digits can detect and correct an error in the message when any 1 digit alters during transmission.&lt;/p&gt;
&lt;p&gt;Throughout, we&amp;#39;ve assumed at most one digit has been altered during tranmission. This is reasonable to assume as it would have to be a very unreliable method of transmission if two digits out of seven were altered!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;/mdoxml&gt;</canonXML>
  <end_user_role>2</end_user_role>
  <difficulty>4</difficulty>
  <keystage1>0</keystage1>
  <keystage2>0</keystage2>
  <keystage3>0</keystage3>
  <keystage4>1</keystage4>
  <keystage4plus>0</keystage4plus>
  <title>Secret Transmissions</title>
  <description>How can Agent X transmit data on a faulty line and be sure that her message will get through?</description>
  <spec_group>Applications
    <specifier>Codes and cryptography</specifier>
  </spec_group>
  <spec_group>Numbers and the Number System
    <specifier>Number bases</specifier>
  </spec_group>
</resource>