Tuesday, September 04, 2018

Why Teach Binary in Computer Science Classes

Sometime when I was around age 11 or 12 I learned about different number systems. I was fascinated with the concepts involved. I literally spent hours experimenting with them. This stood me well when I started studying computer science. We were using Binary, Octal, and Hexadecimal. Octal and Hex are useful for grouping Binary into groups of three (octal) of 4 (hexadecimal). I worked on computers back when one could, and did, toggle code in Binary using switches on the front of the computer. It was awesome.

I’m still fascinated with these systems. I have a Binary clock on my desk and six sided Binary dice in my desk drawer. And of course I try to teach Binary in particular and number systems in general. I’m still surprised that students don’t enter high school knowing this stuff but I guess priorities in education change.

In any case, if you do an internet search for “teaching Binary” you will find a lot of resources and discussions about the how to teach. (My own list is at Resources For Teaching Binary Numbers FWIW) What I don’t find a lot, at least not easily, is justification for why we should teach Binary numbers. It’s obvious to us old-timers. It’s in the curriculum and standards for new teachers. That’s good enough for most of us. For students? Well, students want to know why it is important to learn something.

I asked teachers on Twitter what they said to justify teaching binary. I got some good answers.

There are more reasons as well. Binary explains the limits around the values different data types can hold. That is a key one to me.

Now I want to organize my thoughts and figure out how to present things to my students when I next cover Binary and number systems. Letting students know the importance and having context is bound to help students see the value to what  I am teaching.

So, how do you explain the importance of learning Binary in computer science?

Mike Zamansky said...

Saw the Twitter thread. Figure I'll do a post of my own tomorrow (wanted to wish all the NY Teachers good luck tonight).

Anonymous said...

How many times have you used binary math in the last 20 years? I was a career programmer for 40 years and needed it only a handful of times.

Binary math is like Roger Schank's favorite, the Pythagorean Theorem: we don't need to teach it b/c its not really used. I did carpentry and concrete work for 20 years with my father, who was also a mechanical engineer for Dupont. He said never needed the Pythagorean Theorem (I asked him about it when I learned it in school as a child).

If someone needs to know, they can look it up. But otherwise we're just teaching students crap so that it easy for us to test them. The students are not interested in binary math, nor are the teachers, nor is it of use to them. But since its easy to test for knowledge of binary math and b/c we value easy testing, we're going to cram it into their brain.

See any of Schank's books on education - they are eye-openers.

Alfred Thompson said...

Computer science is about a lot more than just programming. Regardless, I haven't been a programmer for a living in a while. On the other hand when I was I used Binary a lot. Especially when I was doing operating system development and testing.

Michael Ball said...

Whether or not you use binary a lot depends on your programming projects. As more computing abstractions are continually built, fewer people _need_ to use binary. But all abstractions are ultimately leaky -- seeing binary can help explain many issues.

That said, there's tons of valuable reasons to teach and learn binary. I think the ideas of information representation, and limits of such systems are particularly important and tie into much broader topics in CS.

I just wouldn't spend much time on conversions between decimal and binary. If I were going to spend time teaching conversions, it would be to get decent with Hex to decimal, since I think those values appear a bit more often...but still, minimal emphasis on the conversions.

David Nu said...

Because of Computer science is a programming language based on codes and numbers. Binary numbers help to make the code of digits. If you learn computer science in the early age then it becomes easy for future studies. Thanks for this post.

Garth said...

Binary helps understand the background of IP addresses and networking. Can we live without understanding binary? Sure, but then we can live just fine without knowing who George Washington was. I teach binary just so the kids have a little back ground to work with.

Mr. Judkis said...

I think that it's an essential bridge for anyone who wants to understand computing. If you can turn something (sounds, images, words, whatever) into numbers, you can turn it into ones and zeroes, and then a computer can process it. Binary numbers are the link between our analog, continuous reality and the digital, discrete world in which computers operate. The whole subject is really pretty cool. . .

Richard White said...

I have to admit that when I first began teaching computer science I tended to teach binary only because 1) it was theoretically at the heart of our machines, and 2) it was part of any given organization's curriculum.

I have come to have a greater appreciation for binary, particular as my own curiosity (and that of some of my students) has led me to investigate further the "turtles all the way down" that lead from a high-level program on down to machine code.

Of what "use" is it? That depends on your context. For hardcore computer scientists, Turing Machines are based on binary. For programmers, the difference between source code and executable binaries is pretty important to understand. And just about anyone I've ever met who uses a computer or a smartphone, at some time or another, has wondered vaguely what's going on inside the machine. The idea of "encapsulation" (for some, "abstraction") is fundamental.

01010100 01101000 01101111 01110011 01100101 00100000 01100001 01110010 01100101 00100000 01101101
01111001 00100000 01110100 01110111 01101111 00100000 01100011 01100101 01101110 01110100 01110011 00100001