Binary Journey

Create a Code.org account and join the class group at the following location: http://studio.code.org/join/XXQHIF

After you have joined, go to Code.org's CodeStudio for many of the lessons below.

  1. A Two-state Solution
      1. Journal: What are some "binary" messages that have two states? It could be a a simple yes/no question, a whole system of representing information, or something else.
      2. We will call each of these binary messages a bit (short for binary digit).
      3. What are some messages that have more than two states?
    1. With a partner consider how you can transmit a single piece of information which needs to have two "states." Make it as simple and fail-proof as possible. The rules are no flying projectiles and no language or writing can be used.You may assume you have supplies such as legos, string, etc.
    2. Compare with another group, and choose the system that is most fault-tolerant, flexible and extensible. Consider the following:
      1. What if the view is obstructed?
      2. What if the recipient is not paying attention?
      3. How do you know the message was received correctly?
  2. A Multi-state Solution
    1. Journal: Think back to messages that can have more than two states from the previous step.
    2. How can you modify your transmission system to handle these types of messages?
      1. How many of you speak other languages?
      2. How many words would it take to explain how to get from the entrance of the building to our classroom?
      3. How do you compare the density of the different languages you speak?
      4. Claude Shannon explored this idea of information theory, thinking about the minimum number of symbols needed to represent some amount of information. A 2011 Time magazine article describes density of a few different language densities:
  1. Internet Simulator
    1. If you haven't done so already, make sure you join the class group using the address shown at the top of this page.
    2. Watch the demo video or listen to your instructor's explanation. Then start up the Internet Simulator and find your partner. Think of how you would transmit a single A or B. How would you transmit a longer string of A and B? Come up with a protocol to handle the following issues:
      1. How will you know when the exchange is supposed to begin?
      2. How will you know whose turn it is to send or receive the message?
      3. How will you coordinate your actions?
    3. Write down your protocol in enough detail so that you can hand it to another group to evaluate. Swap protocols and evaluate, writing down observations and questions that arise. Think of the bit rate, or how many letters can be sent per second. Is one of the protocols faster than another? Why?
    4. What happens if your partner transmits the message ABAB at half the bit rate you are expecting? In other words, you sample the line twice as fast as they are expecting you to.
Bit Rate Diagram from studio.code.org/s/cspunit1/stage/4/puzzle/4
  1. How do you (bit) Rate?
    1. Take a look at this 6 min. video. What does each of the following mean?
      • Bit:
      • Bandwidth:
      • Bit Rate:
      • Latency:
    2. Why is it important to communicate a timing protocol prior to sending messages?
    3. For each of the following, where are they most commonly used? Why isn't it used everywhere?
        • Copper wire
        • Fiber-optic cable
        • Radio waves
  2. Come to Order
  3. Journal: Given 3 circles and 3 squares, how many unique orders of circles and squares are there? For instance Circle-Circle-Circle is one of them, and Square-Square-Square is another. Be systemic about how you write them down.
  4. What is your ordering system?
  5. Give Me a Hand
  6. Journal: How high can you count using only the fingers on one hand? Your system must be able to represent every whole number starting at 1, up to your highest value.
  7. With 5 volunteers at the front of the room, see how we can count using groups of dots, then 0/1.
  8. Everyone complete a "flippy-do" and use to do number translations between decimal and binary.
  9. For those finishing early, take a look at the Cisco Binary Game.
  10. If you are using the fingers on one hand to show your friends how to count in binary, might they be offended? Why or why not?
  11. Consider the number-guess boxes shown below. How is this related to binary?
Age Guess Number boxes
  1. Picture This
  2. Watch the introductory video for the new version of the Internet Simulator. Use this to transmit simple pictures by only transmitting binary numbers.
  3. Number Systems
  4. Choose at least two different number systems from the links shown on this page. (Optionally one of the two can be from some other numbering system that has at least similar complexity.) In your journal summarize each of your two selected numbering systems and be prepared to present the advantages / disadvantages of each of your two selected systems, and where they might be best used.
  5. Sending Text
    1. Journal: How might we use binary numbers to uniquely identify each member in the class? How many bits would you need in your system?
    2. How might we represent the 26 letters of the alphabet used in text?
      1. With a partner, compare your methods for representing text and choose one.
      2. How might you adapt it to also include punctuation characters and numbers?
      3. What are issues involved in representing other languages?
      4. Test your method using the Internet Simulator.
      5. What is the minimum number of bits needed to represent 26 letters plus a space? How about if we add digits 0..9? How about if we add 24 punctuation characters?
  6. Formatted Text
    1. There is a text encoding convention called ASCII that is widely used, but we still have to consider how to represent formatting such as new lines, itallics, bold, and size (and even elements such as color and font!) For instance, consider what would be involved in sending (and receiving and reproducing) the following:
    2. Whoa, this message sure has a lot of FORMATTING in it!
    3. With your partner, come up with a protocol using the Internet Simulator that would allow you to transmit text as well as line breaks, capitalization, itallics, bold, and 3 different sizes.
    4. Reading Assignment:
        • Blown to Bits - read Chapter 3, Ghosts in the Machine, pages 73-80 (What You See Is Not What the Computer Knows), then answer the following questions:
          • Give an example of your own, to illustrate that knowing “why and how” about a computation tool is important, instead of just saying “it does it.”
          • Summarize how file metadata “fingerprints” a file. Include a discussion of file metadata benefits and challenges.
        • Blown to Bits - read Chapter 3, Ghosts in the Machine, pages 80-88 (Representation, Reality, and Illusion), then answer the following questions:
          • How does highlighting in a PDF doc work? What are the computational ideas utilized?
  7. Text Compression
      1. Make a file with a simple text editor (Notepad on a PC, TextPad on a Mac) with only the word "Hello" in it. Also do this in a Microsoft Word document.
      2. How big are each of the files? Are they the same? Why or why not?
      3. What are Kilobytes, Megabytes, and Gigabytes? What are some real-world comparisons for what can be stored using each of them?
      4. Watch the text compression tool demo video, then launch the text compression tool. Note that a heuristic is a kind of algorithm that is an estimation.
      5. Are some texts easier to compress than others? Why? Is it possible to determine the absolute best possible compression? If so, how? If not, why not?
      6. What is the point of compression?
  8. Encoding B&W Images
    1. "Raster" images are grids with some bits white and some black. See the pixelation widget demo video. Use this to create an image. Transmit this image to a friend using the Internet Simulator and see if they can reconstruct it correctly. What happens if a bit gets changed accidentally? How might we guard against this possibility?
  9. Encoding Color Images
    1. See the pixelation widget demo video that we can use for color images, where we use extra bits to represent the Red, Green and Blue (RGB) colors for each pixel.
    2. We can get shades of different colors by using more bits per pixel, as illustrated in this video. For larger images with lots of bits, it can be helpful to convert multiple bits to the shorter hexadecimal representation, as illustrated in this video.
    3. Create your own Favicon to express your own identity and personality.