Can we get a toddler to program?

Experiments in Programming with a 2-year-old

To answer that question I wanted to figure out if my son could “write” a simple program by manipulating symbols. In the spirit of my How To Train Your Robot game, I decided our contract was going to be “If you show me symbol X, I’m going to jump. If you show me symbol Y I’m going to lift my arms.”

The “symbols” ranged from Lego bricks to toys to stuffed animals.

We tried this when he was around 2 years old. It didn’t work. He was more interested in the physical object that represented the symbol rather than the meaning of the symbol in our “game”. I don’t think it had to do with him not being able to interpret rules, because he understood cause-and-effect (grabbing toys from other kids = timeout). I think it had to do more with not being able to interpret an object as something more than its obvious physical attributes (color, shape, and what happens if you smash it onto something).

Experiments in Programming version 2.5

So, I refined my game into “How To Train Your Robot To Jump”. Our contract became “Pretend I’m a robot. If you place an arrow facing upwards, I’ll jump up. If you place an arrow facing down I’ll do a push-up”. I thought that using arrows to face up or down should be less abstract. Also, I waited until he was 2.5 years old. He was better at paying attention.

We tried this new game and it worked!

Take the arrows…

Place them up or down…

And wait for me to execute the program…

Which is what programming is fundamentally about: use a language to describe a task that is automated and whose results you see after you are done.

(Keep in mind, that girls are more advanced than boys at that age, so my son serves as a how-early-can-a-kid-program upper bound of sorts.)

He was so excited that he wanted to do what I was doing. So, he’d place the arrows and then jump up or drop down.

Then we started getting creative. How about putting the arrows facing left or right and I jump to the left or to the right?

(And how about a couple of dinosaurs around to help us debug?)

There was not much action happening with only 3 arrows. He wanted to keep me jumping. Kids around that age understand numbers, so we introduced numbers into the mix and I told him that if he put the number 6 in front of an upward facing arrow, then I’d jump up 6 times.

We were 10-15 minutes into the game by then, and the game started looking like a real workout (physically for me and mentally for him).

At that point he was more interested in how numbers and arrows looked together in large quantities rather than the program itself. We called it a day. A good one indeed.

I hope we learned something useful today,
DrTechniko

After popular request, in this post I explain how to teach the “How to train your robot” class.

The class is split in two parts.

Part 1 – Guess The Robot

The first part is a game called “Guess the robot”. I show kids slides of different robots and they have to guess what the robot is or what it’s special ability is. At the end of the presentation I explain to them how robots work. In addition, I had a real robot that moved when kids clapped or screamed at it. I used it to show the robot parts and we had some fun making it move around.

You should be able to finish this part of the class in 15-20 minutes depending how many questions the kids ask.

Part 2 – Train Your Robot

The basic process was to get all the kids together to explain to them the game. I use my slides to do that. Then I hand out the dictionaries and pen and paper. I gather all the kids an parents and we first act through all the moves. Then I write a simple program on a piece of paper “move forward, turn left, move forward” and I ask kids to show me what it does. After that we start doing the obstacle course (which I have setup before starting the class).

After they get their “robots” to bring back the ball you tell the kids to invent their own “moves” and so they have their parents doing funny stuff :)

You should be able to finish this part in 30-40 minutes before the kids’ attention span degrades to zero…

Class Materials

The materials I put together to run the class:

  1. Presentation Slides (and Presenter’s Notes).
  2. A laptop or iPad to show the slides.
  3. The Robot Language Dictionary
  4. One pen and paper per kid (for kids to write programs and hand them to their robot parents).
  5. A space where you can arrange obstacles (one or two obstacles to make kids add turns to their programs is enough. I used a gym as you can see in the videos posted on Facebook, but I’ve also run the class in a room with chairs arranged as obstacles).
  6. A ball per kid-robot pair (the ultimate goal is for the robot to get the ball and bring it back to the beginning).
  7. Optional yet fun: A real robot. I bought and built my own basic robot ($50). It took about an hour to assemble.

Class Dynamics

  • Five year olds are better when left alone to create their special moves. They get very creative.
  • Seven year olds need more guidance because they have too many ideas. They’d rather be told what moves to invent.
  • I’d recommend no more than 6 kids in the class, so you can have the situation under control.
  • Try to regroup the kids after their robots get the ball. Explain to them that now they can invent new moves.
  • Parents beware, you may have a serious workout. Kids love to make you repeat stuff 100 times. I advise to wear comfortable clothes.

I would love to hear your findings and see photos from you running the class at home or school.

I hope we learned something useful today,
DrTechniko

Last Sunday, I taught six kids of ages 5 to 7 how to program. “In what programming language?” you may ask. Well…I didn’t use a programming language, at least none that you know of. In fact, I didn’t even use a computer. Instead, I devised a game called “How To Train Your Robot”. Before I explain how the game works, let me tell my motivation.

I learned how to program during my freshman year at MIT when I was 19. It’s not because I didn’t have a computer at home or I hadn’t heard about programming languages. It was because (a) I thought programming was boring and (b) no one had told me why I should bother. In fact, my computer teacher in high school had told me “you don’t need to waste your time learning how to program. Now we have visual tools to build programs. Programming languages are already obsolete.” That was in 1994 and he was referring to Visual Basic. Luckily for me MIT wiped all that nonsense away in a matter of weeks. But does one need to wait to go to college to get the proper education?

Learning how to program is going to be the most useful new skill we can teach our kids today. More than ever our lives depend on how smart we are when we instruct computers. They hold our personal data and they make decisions for us. They communicate for us and they are gradually becoming an extension of our brains. If we don’t learn programming as part of our childhood, we will never evolve. As the famous futurist, Ray Kurzweil, put it “The only second language you should worry about your kids learning is programming.

How To Train Your Robot

The game works as follows: every kid is turned into a “robot master” and their mom or dad becomes their “robot”. I give each kid a “Robot Language Dictionary” and explain to them that this is the language their robot understands. The dictionary has symbols for “move left leg forward”, “turn left”, “grab”, “drop” etc.

The goal is for the robots to go through an obstacle course, pick up a ball and bring it back. The kids have to write a program that will tell the robot how to do all that. Every time they write a program, they hand it to their robot and the robot executes it. To do that, I give each kid a pen and paper where they copy symbols from the dictionary to write their programs and off their robots go!

The fun part begins when each robot retrieves the ball. Now I let kids invent their own moves and symbols that they add to their dictionary and then teach their robots. There is no limit to what the kids come up with.

This is my favorite program (written by a five year old girl):

I designed the class to teach some very basic principles of computer science and programming:

  • Programming languages are just another way to communicate to an entity (via programs).
  • Programs are recipes for automating stuff.


However, I was pleasantly surprised on how much more the kids learned. On their own they figured out the following things (in a 30-min session):

  • Program Parametrization: Instead of putting a forward step ten times, they put a 10 in front of the “step” symbol (A five-year-old figure it out and asked me if she could do it).
  • Composition: Grouping of a set of moves (“move left leg forward, then move right leg forward and do this combo 10 times”)
  • Abstraction: “Run in a circle, then say “I’m dizzy!” , then call this the “Run Dizzy” program and do it 100 times. (For some reason, kids loved making their parents repeat stuff 100 times over.)
  • Unit testing: They’d write a test program to get the parents moving a few steps, have their parents run it, then fix it and run it again, and then add a few more steps until they reach the goal.


I’ve ran the class twice now and I’ve seen the same patterns, which support my belief that when kids have fun, they get very smart and creative about programming. Many of the parents plan to play the game at birthday parties. If you have questions about how to set up the game, don’t hesitate to write. You can find my contact info at www.facebook.com/drtechniko.

You can also find instructions on how to teach the class as well as materials I used on this post.

I hope we learned something useful today,
DrTechniko

This may be the most rude story I’ve ever written, but I had fun doing it, because it illustrates one of my strongest beliefs: “give kids the tools to innovate and don’t limit them”.

Originally I wanted to write a story to teach kids how to draw the different shapes, but I found too many stories and e-books about that subject online. I thought it would be better to write a story about imagination, creativity and innovation and how sometimes we stifle it when we teach our kids in school.

Our hero goes above and beyond and turns squares and circles into works of art. But, no matter how creative our hero gets, the Rude Rollerball Pen will find a way to either take credit or belittle our hero. Our hero is patient until she has had enough and so she drains the Rude Rollerball Pen and all of its suppression.

The lesson here is simple: push your kids to innovate, and if anyone tells them they can’t do it, teach them to have the strength to set these rude repressors aside.

 

I hope we learned something useful today,

DrTechniko

 

I’m a rollerball pen and I’m rude and so bored.

You must play with me. I will not be ignored.

You will draw me a circle inside a huge square

Or I’ll draw in your nose a long curly hair.


Time’s up!


What is this that you drew? Do you think I’m a fool?

Oh! You used a big Square and you drew a big pool

And you painted a Circle as a shiny red ball.

Not that bad. It’s because of my skill after all.

 

—-

 

I am a rollerball pen and I’m rude and need food.

I must eat something yummy or I’m up to no good.

You must feed me a Circle from out of a Square

Otherwise I will smudge lots of ink on your chair.

 

Time’s up!


Let me see what you drew now, you wily old fox.

Ha! You used a fat Square and you drew a fat box

And out of a Circle you made a sweet pie

It is mine! It’s all mine! There’s no need to ask why.

 

—-

 

I am a rollerball pen and I love to be rude.

So be nicer to me or I’ll paint in the nude.

You will cut me a Circle from the edge of a Square

Or I’ll pee on your clothes. You’ll have nothing to wear.

 

Time’s up!


Let me see! Let me see. Do we have matching styles?

So you used some flat Squares and you drew some flat tiles…

And then out of a Circle you made a deep sink?

That’s so rude! I am leaking! I ran out… of… ink…


Last week I finished an online digital painting class at schoolism.com taught by the legendary Bobby Chiu. To show you how effective the class was, I learned how to turn this:

Into this:

And then into this!


All from the comfort of my home and time schedule using only Photoshop and a digital tablet.

I’m not a professional illustrator (yet), but I feel like I learned some amazing skills from a world expert on the subject and I felt like a kid having fun. So, I wondered “Could kids benefit from online schooling?”

So I thought of some benefits and drawbacks of online schooling compared to traditional schools:

Benefits:

(The online schools I include above do not target children per se, but I don’t see why their models couldn’t be adapted for children.)

Drawbacks:

  • Schools are not just about knowledge transfer, they ‘re also about making friends and getting exposed to the real world away from home.
  • It’s hard to enforce the “rules” when the teacher is not physically around.

As far as “enforcing rules”, a “virtual teacher” technology can easily be applied to record scores and progress as if the teacher was around (with deadlines, online testing etc.). So the most serious drawback of online schooling is the lack of the ability to socialize. Even though there are options that mimic social interaction online a la Facebook (schoology.com), unless kids leave home and meet other kids in person, they will miss out on a big part of life lessons if we replace schools with online learning.

So how about turning schools into “social activity centers” to get kids to play and interact together while they get schooled online? For the first time in history, we could give kids the opportunity (especially in developing countries) to get quality education from anywhere anytime at the fraction of the cost of traditional schools.

What do you think?

Many times I’ve heard people ask first graders “what is your favorite class in school”. The child is forced to choose one subject: sports, math, language etc. That trend continues throughout school and students tend to become one-dimensional. Too much focus too early ends up hurting our problem solving skills, because we lose the opportunity to build extra thinking tools and models that can be composed together.

StoRy 4 illustrates that taking a step back, thinking outside the box and composing abilities can solve a problem even if it appears to be unsolvable. Not until the Number 4 and the Letter R realize they can combine their spelling and counting abilities can they figure out that R is the fourth letter in the word FOUR.

The story also introduces the array, a data structure that appears everywhere in science (especially in computer science). An array, is basically a list of items that can be identified by an index/position. In our story, the array is an array of characters (F-O-U-R), also known as a word.

Here are some comprehension questions you can ask your children:

Q: What is the 4th letter of the word LETTER? What’s the position of the letter B in the word NUMBER?
A: T. 4.

Q: What’s more useful: Counting or Spelling?
A: Both are equally useful.

Q: Why was the Number 4 smiling at the end?
A: Because at the end, FOUR had 4 boxes and R only 1 inside the crossword puzzle. Moreover, it was all because the Letter R jumped into the box thinking that this would make it win the argument against the Number 4. If the Letter R hadn’t jumped into the box, then the Number 4 would not appear in the crossword puzzle at all.

I hope we learned something useful today,
Dr. Techniko

The Letter R and the Number 4 bumped into each other in front of the same box in a crossword puzzle.

The Letter R wanted to get into the box.

But the Number 4 would only let the correct letter into the box.

“Arr! I’m the letter R and I’m the rowdiest letter of all. This box is super-duper perfect for me. I’m jumping right in!”

But the Number 4 was not willing to let things get out of order.

“I’m the Number 4 and I’m guarding this box, because this box is the fourth box. Only if you are the fourth letter in the word I will let you in.”

“Well… the word is ‘FOUR’ and I’m the Letter R, so spell ‘FOUR’ and see if I’m at the right box.”

“I’m… I’m… I’m… a Number. I can’t spell.”

“How sad… Now, can you move aside so I can get into the box?”

But the Number 4 did not move.

The Number 4 did not let things get out of order.

“If you spell ‘FOUR’ then you ‘ll see if you are the fourth letter.”

“Only then I will let you in.”

“I’m a Letter. I don’t do counting.”

“And I’m a Number. I can count but I can’t spell.”

“Arrr! If you knew how to spell ‘FOUR’, then we wouldn’t be sitting here forever!”
“FOUR”
“F…”
“O…”
“U…”
“Arr!”


“Well, I like sitting here. I like counting over and over. It’s quite soothing…”
“1”
“2”
“3”
“4”


“Arr! Arr! Arr!” yelled the Letter R in frustration.
“F..”
“O…”
“U…”
“Arrr!”

“1”
“2”
“3”
“4”
And suddenly…


The Number 4 had an idea.

“How about you spell ‘FOUR’ and I count at the same time?”

“I ‘ll stop counting when you say ‘R’.”

So the Letter R said, “OK. Let’s start.”

“F…”

              “…1”

“O…”

             “…2”

“U…”

             “…3”

“R…”

             “…4”


“Arrr! So I am the fourth letter in the word ‘FOUR’ after all!”

“I believe this is correct,” said the Number 4.

“Arrr! Arrr! The box is mine!” said the Letter R and jumped inside the box.

“This is the greatest box ever.”
“Too bad you’ll never have a box of your own, Number 4.”

“Are you sure about that?”

“How about you look OUTSIDE the box?”


“That’s good.”

“A bit more…”

“Very good”
“Just a tiny bit more…”

THE END

The second part of Story 3 explores more aspects of the DNA molecule both when used as a message and when used to create new organisms. Also, we take a look into biological processes that are defined in terms of positive and negative feedback loops.Here are some questions you might want to discuss with your kids:

Q: What happens when we change a sequence in the DNA or we start messing with the DNA strand and we cut and paste pieces from other DNA strands into it?
A: We get an engineered DNA strand that may or may not exist in nature. The change can be as small as changing the color of your hair or as big as transforming you into a new type of organism altogether, like a mutant.

Q: What do you think is Daena’s best quality that makes her a great DNA detective?
A: First, she knows her biology. Second, she is inventive and tries to find solutions based on her knowledge. Third, her solutions are not complicated. They are simple and they work.

Q: How did Daena beat the Ugga Ugga virus at the end?
A: First she changed the DNA of the Ugga Ugga virus to create a stronger (and not evil) virus, the Gaga Gaga virus, and then used the Gaga Gaga virus to kill the Ugga Ugga virus by creating a negative-positive feedback loop.

Q: How does a negative feedback loop work? Can you show an example of a negative feedback loop at your home?
A: A negative feedback loop works by regulating the amount of something. The more of the “something” we have, the feedback loop will try to make this “something” less. The less of the “something” we have, the feedback loop will try to make this “something” more.
This is for example how we maintain temperature in a house using a thermostat. In this case the “something” is the “heat”. The more heat we have, the thermostat will tell the A/C to blow cool air into the house to bring down the heat.

I hope we learned something useful today,
Dr. Techniko

“We need to catch one of these viruses and …” but before Daena could form a plan, the big hungry monkey head with the twisted sharp teeth started approaching them.

“DannyBot, this Ugga Ugga seems to take an interest in us. We should head back and reevaluate. I’m not in the mood for drama.”

They turned around but another Ugga Ugga virus blocked the exit.

“Dannybot, without being too dramatic I think we are …”

The virus zoomed at them, mouth wide open.

“DOOMED!”

But the next instant the virus was caught by a lasso made of DNA coming out of … DannyBot’s body. The lasso wrapped the virus around the mouth and body tight as a squeezing tentacle. Once Daena realized they were safe she headed to the exit, DannyBot and their new prisoner behind her.

“If I were not under the shock of a near-death experience, I would be impressed. Dannybot, I didn’t know you could do that.”

“It’s quite a basic function I’ve been designed for. My lasso makes bonds at the molecular level with the object so the object is unlikely to escape,” said DannyBot as if he had lassoed a harmless-looking water molecule.

They dragged the Ugga Ugga prisoner to the closest White Cell headquarters, at the tonsils.

DannyBot constructed a message from DNA, asking for permission to see the Warden and gave it to the nearest guard. It felt like a lifetime until the gate opened. When they found the Warden he was floating around his office, eating random proteins. He looked quite well-fed in fact.

“What can I do you for, Miss Daena?” asked the Warden.

“First of all, it’s DNA Detective Daena. Second, you ‘ve been infected by a genetically engineered virus. As proof, I brought a sample right here into your office.”

“He don’t look so dangerous to me. Just a monkey face. We ‘ll take the prisoner from here. Off you go now.”

The guards escorted them out of the headquarters.

“I assume the mission has been completed. Shall I set course for the extraction point?” asked DannyBot.

“Nothing would cheer me up more, but I have a depressing feeling about this. Let’s just wait out here. How much time left?”

“There are three hours left to total infection.”

It felt like forever until finally the gates opened. At first, it looked like the Warden coming out of the gates. But as he moved out of the gate and into the light, he didn’t look as white as before. He looked dark and ugly and had twisted sharp teeth. Like an Ugga Ugga virus!

The two guards at the gates tried to swim away, but before they could escape, a hoard of hungry monkey faces stormed out of the gates and brought an end to them.

“Eat my children. Eat and multiply!” said the Warden as the monkey heads swarmed the area. Then his eyes fell on Daena. He started eating his way towards her in a steady pace.

“This doesn’t look good. DannyBot, let’s hide before more of these monsters realize we are here!”

“Don’t go Missy. Come and feed me,” said the Warden, and then gulped down a couple of his children.

They zoomed away from the tonsils and went into hiding behind the nose. “The Warden might be slow, but his children are multiplying. How much time left, DannyBot?”

“We have entered the last hour.”

Daena sighed. This was all very stressful. She wished she was back inside her vial even if it was not near a window, even if had to look at the same sticker all day:

-The recipe of life and death lies in the DNA-
The recipe lies in the DNA, she thought. Her mind drifted off to her first class at the detective academy and the principle-of-life rule they all had to memorize:

The DNA recipe is written with 4 letters.

What are they?

T, G, C and A.

And when DNA splits in two

Each half is called RNA

And every letter T is replaced by a U.

“That’s it!” Daena jumped with excitement. “I figured out how to kill the Ugga Ugga virus! The recipe of life and death lies in the DNA. Get it, DannyBot?”

DannyBot blinked.

Daena sighed. “Ugga Ugga’s DNA contains the recipe for making an Ugga Ugga virus. It’s like when you read a message written in DNA language using the T, G, C and A 4-letter alphabet. Only the message is also the recipe. Do you see?”

“I don’t see how this helps us defeat the Ugga Ugga virus,” said DannyBot.

“Well, here is the missing puzzle piece. DNA doesn’t make the Ugga Ugga directly. It has to first split into two RNA strands, and in the RNA alphabet T is replaced by a U.”

“I don’t see how this helps us defeat the Ugga Ugga virus,” repeated DannyBot.

“Don’t you get it? What’s the code name of the Ugga Ugga virus in RNA alphabet?” said Daena as if explaining the concept to a hydrogen atom.

“U-G-G-A-U-G-G-A,” said DannyBot.

“Can you search your data for the U-G-G-A-U-G-G-A sequence in the Ugga Ugga virus’s RNA?”

A few moments later DannyBot said “I searched. I found the pattern.”

“Great. I want you to synthesize the same RNA strand but replace the U-G-G-A-U-G-G-A pattern with the G-A-G-A-G-A-G-A pattern.”

DannyBot synthesized the mutated Ugga Ugga virus strand. One by one he glued together A’s and C’s and G’s and U’s until he had a full RNA strand.

“The sequence is ready. But I don’t see how this helps us defeat the Ugga Ugga virus,” said DannyBot.

Daena closed her eyes. She wished she had a hydrogen atom for a partner.

“Because if we get the Warden to eat this mutated Ugga Ugga strand, then he will use the wrong recipe to make children. His children will be Gaga Gaga viruses instead. Then the Gaga Gaga viruses can fight the Ugga Ugga viruses. I think it’s time to pay a visit to these depressing monkey faces.”

They zoomed back to the tonsils with the Gaga Gaga strand in hand. The Warden eyed them with a hungry look.

“Bring them to me, my children!”

Before Daena and DannyBot realized what was going on, they found themselves wrapped by DNA lassos from a bunch of Ugga Ugga viruses.

“My calculations tell me he means to eat us,” said DannyBot.

“You depress me.”

“Miss Daena. Why so gloomy? You should be happy, because you’ll make a tasty snack,” said the Warden and opened his mouth.

“Wait, wait! You don’t want to eat me like that. I’m more tasty if you eat this first as an appetizer,” Daena waved the Gaga Gaga virus strand in his face.

“You ‘re a real lady,” said the Warden and he gulped down the Gaga Gaga strand. He burped and said “Missy, that was really yummy. Remind me to get the recipe after I eat you.”

He came closer to Daena, opened his mouth and was about to close it over her head, but instead he grew and grew and grew until he… burst and a bunch of Gaga Gaga viruses came out of his body.

Soon a war begun between the Ugga Ugga and the Gaga Gaga as they started eating each other. Whenever an Ugga Ugga ate a Gaga Gaga, it gave birth to Gaga Gagas.

But, whenever a Gaga Gaga ate an Ugga Ugga, it gave birth to Gaga Gagas. Soon the Ugga Ugga’s were wiped out.

“He should not have eaten the Gaga Gaga strand before checking it, but I didn’t think it was a good idea to tell him,” said DannyBot.

“DannyBot, you are learning. Yet you still have ways to go to before you understand the genius of my scheme that killed the Ugga Ugga virus.”

“There was nothing to understand. It was based on a pair of positive and negative feedback loops. It is quite a very elementary and primitive principle of life,” said DannyBot.

“You really depress me.”

Follow

Get every new post delivered to your Inbox.

Join 39 other followers