Showing posts with label binary. Show all posts
Showing posts with label binary. Show all posts

Weaving Binary and Peeing in Buckets

Tuesday, September 13, 2016

Weaving! Today was craft day in CS Principles. We are starting binary numbers - and if you think weaving in a computer science class is odd, Ill have you know that one my favorite computer science book ever was A Computer Science Tapestry by Owen Astrachan. It totally relates.

I borrowed a frame from our art department and set up the warp using this description:



I used cotton for the warp and wool for the weaving. Using a  needle and thread I got us started, then we passed it around and everyone took a turn:?




So, why weaving in computer science? Binary is the mast basic way of communicating weaving and knitting patterns. Think knit - purl - knit -purl. In weaving it is over - under - over - under. Alternating rows of over - under gives a small checkerboard pattern. By changing this we get different patterns in cloth.


Houndstooth Pattern


This brought on a whole load of questions, and we did get off topic a bit. One kid brought up that the Romans used urine to dye fabric...and in fact To dye animal fibers you need an acid to fix the color to the fibers, which is why Kool Aid can be used to dye hair, or wool. Uric acid was the first commercially available chemical. Long time ago folks used urine to do indigo dyeing, which meant collecting a lot of the stuff. In a bucket, in the barn.

We did finally get back on track and watched a video on Jacquard Looms. I know we always use the examples of punch cards coming from looms, but really who cares? Today was the first time in all the years I have taught this that it mattered at all to the kids. Doing the weaving first made them really ask a lot of good questions about the loom. And the idea of storing a pattern and algorithm in a binary system is the basics of everything we do.
?
The final Product, its a bit lumpy, but it is made with love.


They really got into this and had lots of questions. Had I known I would have set everyone up with a loom so they could make their own. Might be an interesting extension to give them a pattern in binary and see what the design ends up being.

After the weaving we started on binary numbers. Last class we spent about 20 minutes doing an activity covering how base ten numbers work. Today for the fast start their question was "if you only had 1s and 0s to represent numbers how would you represent 0, 1, 2 and 3?" Lots of good debate over how to show certain numbers.

Last we made our Analog Binary Calculators that well use the next few classes as we go more in depth on how binary works.


Thirteen!


Update: Here is a post about the weaving program at the Henry Ford Museum in Michigan. I got to see the Jacquard loom in action last summer when I was there for Maker Faire.
Read More..

Binary Flippy Do How To

Monday, April 25, 2016

Today in AP Computer Science Principles we made the Analog Binary Calculator. We have been working up towards binary. I do not start them with the big explanation of This Is Binary.

Instead I do a series of puzzles as warm ups and exit tickets for the week or so before the actual lesson. That way by the time we get to full scale binary they have had some positive experiences and built their own understanding of how binary works.

(Why do I even do Binary? Here you go)

So for example I show them a picture of two light switches and point out they can either be on or off. Working with a partner they have to figure out how many numbers they can store using the light switches. What if we add a third switch, how many then? Without listing all the combinations can you predict how many numbers you could represent with 4 switches? This makes a great warm up activity.

The great thing about the flippy do is it is super easy to translate numbers back and forth. My stronger math kids pick up the number theory behind it quickly, while my weaker math students are successful so they will stick with it rather than tuning out.

If you also cover the full twos comp representation it is also an incredibly easy way to teach the steps.



Materials:
  • Index cards - 4x6 or larger
  • Markers
  • Scissors 
  • Rulers - helpful, but not necessary


Steps:

First you fold up the bottom 1/4, draw 8 columns, and cut the bottom flippy things like this:

Can you tell this is my white board?

Second, you label the powers of two. Then put 1s on the back of the flaps and zeros underneath as shown:



Then I have them do a few puzzles:
  • How may ways can you represent 13? 3? 15?
  • Count from 0 to 13. Any pattern with even/odd numbers?
  • What is the largest number this can store?
  • What is 01111111? 00111111? 00011111? - what is the pattern here?
The point here is, if I just tell them that there is only one way to make any base ten number in binary it goes in one ear and out the other. Snore.

If instead they are doing a puzzle, and after a few realize THEMSELVES that there is only one combo per number, they internalize that at a different level. They dont forget it.


After all this we do the algorithm to change from binary to base ten and back. The best part is when the kid in the back, the one that hates math, tells their neighbor "Hey, I actually get this".
Read More..

Why Binary

Friday, February 12, 2016


I was challenged by a parent last year about why we teach binary in our CS classes. Honestly I didnt answer too well. I was in a bit of shock, good shock - it is not often I have a parent have much of an idea about what we teach in CS.

So I didnt answer well. But I do teach it, and for very specific reasons.

Analog Binary Calculator


You have to be intentional about why you are teaching anything. Are you using it as a way of dividing the smart and the dumb kids? We might not state this as a goal, but often difficult topics in class create just this divide. This group gets it easily, so they are valued more than the kids that struggle. Think back to the last class you really struggled in and be honest - it can feel that way. As a non-speller this was a lot of my own elementary experience.

So as a community we have to move beyond teaching a skill for the sake of the skill. Frankly teaching something like binary is a bit of a cheap trick. Here are the steps you perform, practice those steps, now demonstrate mastery. Especially for those of us with a math education background this is exactly how we were taught to teach. To some degree this is training behavior, not teaching content.

CS gives us the opportunity to move beyond basic skills and give them context. We see this same issue happening in math. The kids dont get WHY they have to do fractions, so rather than provide a context, we hand them a calculator and move on. Most of them will never use it anyway, right? We rob them of a deeper understanding of their world when we take the easy route.

So, why do we bother with binary?

It is our job to constantly link these skills based topics back to the bigger questions of CS. Binary is foundational to understanding how computers act and what they can and cannot do.

So as you teach binary your students should be writing and answering questions. This is a perfect time to explore what kinds of problems computers can solve. Why is it fairly simple to search a cell phones address book for your grandmas phone number, but you cannot just type in "solve world hunger" and get a solution? Well, part of the answer is the kinds of things computers can store. We can easily download Shakespeares Hamlet, but we cannot get the computer to read it for us and list the major themes. That kind of processing is, for now, outside its abilities.

And this is something students of any level can discuss. Perhaps not to the same depth or level of analysis, but they can form knowledge around it, and in fact they should.

And back to teaching the skill, it is also our job to teach difficult and abstract things with appropriate scaffolding so that all kids can get some level of mastery.  Again, not every kid will fully absorb the amazing beauty that is the twos comp algorithm, but if they have done it they will better understand why int x =/*insert hugemungous number*/ pops around and gives them a negative number. And maybe when that kid has gone off to college and is sitting in a very intimidating CS class they are that much less likely to drop it.

So for me binary is a cheap trick, but not for the skills sake, but as a bridge to the bigger philosophical ideas that should be a part of CS education. Every person should be thinking about these things. It impacts us all.
Read More..