STEM Activities to Learn How to Code

STEM (Science, Technology, Engineering and Math) is an important part of the world today. More so, learning to write code and think like a computer is becoming a large part of many of the jobs that make up our economy.

Actually writing code requires access to a computer, but there are lots of great activities that you can do without a computer to learn to think like a coder. By doing some of these activities you will develop your thinking skills, you can get your brain ready for the next time you do sit down in front of a computer to write some code.

Finding Algorithms in the World

An algorithm is a set of instructions that a computer uses to perform a complex action. Our world runs on millions of algorithms, both simple and complex, that can be easily observed. In this observational activity, look around you and try to see the algorithms at work. One example that is interesting is traffic lights.

Every traffic light has an algorithm that determines when it changes color, how long it stays a color, and so on. If you sit at an intersection and watch for a while, you will see a pattern that develops. How does that pattern change when there are no cars going a particular direction? What about more cars vs. fewer cars? See if you can identify the algorithm that is at work.

Once you understand this process, try some other automated devices. How about an elevator, or a vending machine? In the world around us, algorithms are everywhere. Once you see them in some things, you’ll start to see them everywhere.

Graph Paper Blind Picture Copy

Starting with a blank piece of graph paper and a pencil, fill in 10-15 squares to make a unique design. Give a partner a blank piece of graph paper and a pencil, try to give them instructions to re-create your design on their paper. Here’s the tricky part: You need to give them the instructions without them seeing your paper, and without you seeing their paper as they draw.

When you are done, compare the two drawings and see if your instructions could have been improved to make sure that the two pictures matched at the end. What you have just done is create an algorithm (instructions) similar to the ones that computers use every day.

Maps for Friends

Pretend you are burying treasure somewhere in your yard, at school or at a park nearby. Obviously, you can’t put up a big sign that says “BURIED TREASURE” or someone will get it. What you need are instructions to find the treasure, so that only the person who has the instructions can find it.

Once you have chosen a secret location, write some instructions to find the treasure. Give them to a friend, and see if they can find the same spot by using only the instructions. If your friend started at a different spot, do the instructions still work?

Every day, these are the kinds of problems that computer programmers have to solve, so that their code will be able to do its job in a variety of different situations, and be used by lots of different people. By thinking through these issues, you can learn to think like a computer programmer too.