Showing posts with label Big Idea - Abstraction. Show all posts
Showing posts with label Big Idea - Abstraction. Show all posts

Monday, September 23, 2013

Binary Flippy Do - How To

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 two's 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 1's 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 don't 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".

Tuesday, April 23, 2013

Great Logic Gates Video

In CS Principles we have moved on from Data and are now covering Questions. In this unit we cover logic gates and if-thens. I want the students to make a connection between the hardware, all the binary we did earlier in the year, and how conditionals work in programming,

image from logic.ly online demo


Logic Gates Video

This explanation starts with a scenario - What if you need to trigger an alarm in a room with two sensors?

I love this approach. So often we start with the truth table, then go to a scenario, and by that point you have lost them.

After this we used the Logic.ly website to let them try making their own logic gates.

Next class we'll be watching this video explaining how the OR and AND gates are made. The students had a lot of questions about this today and this makes it pretty clear.

Tuesday, March 12, 2013

Why Binary?


I was challenged by a parent last year about why we teach binary in our CS classes. Honestly I didn't 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 didn't 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 don't 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 phone's address book for your grandma's 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 Shakespeare's 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 it's 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 two's 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 skill's 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.

Monday, December 17, 2012

Why Code Academy is Awesome

We have been using Codeacademy in the CS Principles course to cover HTML and CSS (the abstraction part of the Big Ideas). IT is a great tool - lets the kids self pace, give instant feedback. They have made some pretty amazing things.

Plus the site uses badges to track progress. You know how I love badges.



I just got this e-mail from them - such a grreat summary of why Computer Science is important:

You’ve been a Codecademy student for a month now. Well done!

Here’s why that’s great news for you:

We believe that learning how to program is the best job security you can have because it’s more important than ever before to understand the systems we depend on every day.

The need for computer literacy has never been greater. As a Codecademy user, you’re getting a head start in many ways:
  • You’re learning how programs function, and how to control them
  • Programming is a skill that’s virtually guaranteed to help you get a job
  • By learning to code, you’re becoming a creator: someone who makes things happen
  • You can create programs, games, web pages and animations
  • As your coding skills grow, you can share knowledge and even teach your skills to others
  • In a world of tech consumers, you’re becoming an empowered builder…
Nice work!
So don’t stop here. Why not master a topic right now?
Exactly.

Thursday, September 20, 2012

Weaving Binary and Peeing in Buckets

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, I'll 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, it's 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 1's and 0's 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 we'll 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.

Tuesday, June 26, 2012

CS Principles Bookshelf

One of the things I get asked most often about the pilot is "What textbook are you using?" In reality limiting the course to one book isn't possible. Part of the whole point of the curriculum is broadening the focus beyond just teaching coding.

Also, computer science is by its very nature is not static. Having a great set of reference books to work from has been essential this past year.


These three were my main resources:
  • Computer Science: An Overview by J. Glenn Brookshear
    • This book did a good job of covering the basics, plus it covered some other areas like artificial intelligence and computer graphics.
  • Computer Science Illuminated by Nell Dale and John Lewis
    • This one takes a layered approach starting with the information layer of how data is stored and processed and then moved up through applications. Each chapter had a good set of thought questions, beyond just simple vocabulary and multiple choice, that related to the topics covered.
  • Explorations In Computer Science by Mark Meyer
    • This books takes a laboratory approach with a series of hands on applets. Great for brainstorming how to approach a topic.
Some other books I used. If you haven't guessed I am a huge reader, so this is just the tip of the iceberg.
  • Introduction to Computational Science by Angela B. Shiflet and George W. Shiflet-
    • This book was new to me this year. One of the hardest areas to teach with the CS Principles course was Large Datasets. While the book is over the head of your average high school student, it is a fabulous resource for teachers. It is all about how computers are used in modeling and simulation and has an entire module on errors in modeling. Each topic covered has several case studies that range from Drug Dosage to Skydiving to Mushroom Fairy Rings. Great examples to pull from.
  •  Code: The Hidden Language of Computer Hardware and Software by Charles Petzold
    • This covers the first steps of representing data as a code - like Morse code all the way through graphics. It is clear and easy to follow with fun examples. It is a it a level high school students could follow most of it, although some passages get a little more mathy than most students are comfortable with. This is one of the books I came back to again and again.
  • The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography by Simon Singh
    • This is one of my all time favorites. His website also has lots of great interactive tools for teaching on this topic. I have used the digital version in class for several years. I also have developed a set of  hands-on cryptography activities whenever the network is down at school-like Caesar sticks and Morse code.  Understanding some of the history of how humans used encryption to send messages makes the abstraction of computer science easier to understand

Friday, May 18, 2012

No peeking

This video was recommended for explaining public-key encryption. It uses ttheidea of mixing paint colors to explain how public key cryptology.



It is part of a series of vidieos from the YouTube channel: Art of the Problem. Here's the full website.

Monday, April 16, 2012

It's Logical

Logic.ly Software
My goal with the CS Principles course this year is to make connections. We've been working on if/thens in C++ for the past week. Tomorrow we transition over and start looking at logic gates. My hope is they connect all the binary and hardware stuff we did at the beginning of the year to the logic we have been using to write if/then statements.

I have been playing with several logic gate emulators to find one that is a good fit.
  • Logic.ly This is my favorite interface for these programs. it is easy to use, and the graphics of a switch and light bulbs help make it clear what these tools are doing. This is not free, it costs $29.99. There is a good on line demo that is free, but students cannot save their work.
  • Logic Gate Simulator   This one is shareware. Great interface and I love that I can send it home with the students if needed.
So far so good - now I just need to figure out how to asses this. It is easy to test if the students can add binary numbers, or create a specific logic gate, but trying to tell how much they get at a conceptual level is much harder.

Saturday, March 10, 2012

Play Dough

We will be doing this:


This Ted Talk covers using conductive play dough to make simple circuits. I am trying to think of a way to work this into doing logic circuits.

I might be over thinking it...the best approach might be to hand the materials to the kids and tell them to design the gates, and see what they come up with without my help.

Friday, August 12, 2011

Computer Architechture

For the new CS Principles class this next year I am panning on covering a bit more about computer architecture than I normally do in class. I'd like to spend a bit more time on things like the von Neumann Architecture and logic gates. For the APCS curriculum this won't have much impact, but for the IB students having a more solid foundation will help.

  1. You Tube Video on von Neumann architecture
  2. You Tube video on Computer Architecture
  3. Flash Memory
  4. An Intro to CS course from Central Connecticut State University. Has a good introduction on computer architecture.