In this lesson students will send a simple line drawing to a classmate. Students will be presented a grid on which they will draw an image (connecting 3-7 dots with straight lines). They must develop a protocol which will allow them to send any image they might create on their grids, paying particular attention to how many bits are used to represent each binary number. Students will therefore have additional practice encoding and decoding binary numbers and develop further intuitions about the properties of binary numbers in a hands-on way.

**Protocol:**A set of rules governing the exchange or transmission of data between devices.

Students will be able to:

- Calculate the range of values that can be represented using binary numbers of a given size in bits.
- Invent a simple communication protocol for sending a list of numbers that represent coordinates on a cartesian grid.

The main purpose of this lesson is to reveal that just because we now know how binary numbers work, there are still challenges of information representation and communication. In particular we are intersted in developing a more robust protocol for sending a list of numbers over the internet.

Students will need to make choices about how to structure their messages in terms of number of bits to use for each number and even how to communicate the beginning and end of the list. While the binary number system can be used to represent any value we wish, in practice the range of values we are able to represent is limited by the number of bits we use. Thus, protocols for exchanging binary information must specify in advance how many bits will form a single number among other things. Without knowing this information the receivers of a message have no way of determining how to break up an incoming stream of bits into individual numbers; it will just appear to be a random string of 0s and 1s.

- Sending Numbers - Activity Guide, pdf
- Sending Numbers - Activity Guide, docx
- Sending Numbers - Graphing Worksheet, pdf
- Sending Numbers - Graphing Worksheet, docx

Review properties of binary numbers covered in the previous lesson, especially the relationship between the powers of 2 and the number of bits you need to encode a particular number. Here are some sample questions you can throw out:

- "
*How many more numbers can be represented with 4 bits as opposed to 3?*"- Twice as many. Every time a bit is added the number of values we can represent doubles.

- "
*What is the highest value I can count to using 3 bits? What about with 4?*"- With 3 bits, 7. With 4 bits, 15. In general the answer is 2^(number of bits) - 1

- "
*Justify the following claim: Regardless of the number of bits in our binary number system, the first value we represent is 0.*"- This is actually the case in any number system that uses place value. The smallest value we can represent is composed of all 0s and is exactly 0.

Distribute the Activity Guide and Graphing Worksheet. Today students will combine what they have learned about communication protocols and binary numbers. Put students in pairs for this activity, which will ask them to invent a protocol that allows them to send a list of numbers to represent a drawing. Give students time to discuss their protocol with their partner before transferring all communication to bits. Once the discussion time is up students will only be able to communicate through their piece of paper using bits to represent numbers. Remind students to discuss how the points they are connecting will be formatted within the message, (e.g. how many bits they will be using to represent each number).

Students should be encouraged to make a simple drawing. A geometric shape, or the first letter of their name is a good option. A shape that can be drawn with about 3-5 points is a good goal.

Students can use the three different-sized graphs, on which they could scale their initial drawing to be different sizes or draw different images. Either way, it may necessitate the creation of different protocols.

Have students test out their protocols with one another under the conditions defined on the sheet. Have they accounted for every possible scenario? Does everyone feel comfortable encoding and decoding a message?

Have students compare their results to see if their drawing came out right. If it didn't, have students write a sentence or two about what went wrong, if the problem was preventable, and whether they need to change their protocol.

- What problems arose in your efforts to create a working protocol? How did you think about the problem(s) in order to solve it?
- You have a coordinate grid that is 96 x 96. Assuming that you encode the x and y coordinate as
separate numbers, what is the minimum number of bits that you will need to encode a coordinate in that space?
- a. 16
- b. 14
- c. 13
- d. 10

- Develop a protocol that allows the user to send a calendar date (mm/dd). What is the minimum number of bits necessary?
- Develop a protocol that allows the user to send a time (use 24 hr military time hh:mm:ss). What is the minimum number of bits necessary?

- Develop a protocol designed for a graph that is not square, e.g. 50 * 200. How does this alter the format of your protocol?
- Develop a protocol that can communicate locations on the surface of the earth. Longitude and latitude might be helpful tools to use.

**CSTA K-12 Computer Science Standards:**CT.L2:14, CT.L2:7, CT.L2:8, CT.L2:9**Computer Science Principles:**2.1.1 (A, B, C, D, E, G)**Computer Science Principles:**2.1.2 (A, B, C, D, E, F)**Computer Science Principles:**2.3.1 (A, B, C, D)**Computer Science Principles:**2.3.2 (A, B, C, D, E)**Computer Science Principles:**3.1.3 (A, B, D, E)**Computer Science Principles:**6.2.2 (D, G, H)