Programming for Kids - True or False

True or False

Let's play a game. I'll make a statement and you tell me if you think it's true or false. True or False, the fastest land animal in the world is the zebra. Do you have your answer?

Image

Do You have your answer?

The answer is False... The fastest land animal is the Cheetah. Cheetah's running speed can reach anywhere from 75 miles per hour. Whereas, Zebra's can run up to 40 miles per hour.

Whether you got it right or not, now you know that cheetahs will beat zebras in a race any day. We can now call this a true statement, because moving at 75 miles per hour will always be faster than moving at 45 miles per hour.

We as humans evaluate statements everyday to verify if it is true or false.

Just like when we you decide to cross the road, you look left and you look right to watch for cars. When you stop to think about it, you are making a statement that you can act on. Is there a car coming towards me? True or False. If you look and you don't see any cars the answer to the question is False. If there is a car coming towards you the answer is true. There are no cars coming towards you so you can cross the road. We as humans make judgement calls base on true and false statements all the time. It happens so fast that we sometimes we don't really know we are doing it unless we focus on it.

Computers can also learn true and false

We are not saying that computers can know the difference between good and evil. Computers are not capable of making moral decisions. Since, a computer is simply a machine with only wires and electricity. True and False are values that are different from good and bad.

Remember in our last lesson we ask our computer to store a number in our box toys. Image

We know from our last lesson we can ask the computer simply tell us how many toys are in the box. But as you will see in a latter lesson, why knowing the true or false value can be so important.

Let's now try the true or false game with the computer and see if what it can tell us about it. "How many toys are in the box?" True or False Version.

Image

We can continue playing the game with the computer, but you get the idea. In reality we already know that 3 is in the toy box. In fact programmers, have to know what is in the box. The goal is as we will learn in our next lesson how to use true or false statements to help computers make complex decisions like us humans.