Everyday routines to explain Algorithms & Flowcharts.
People and computer machines are two different worlds. Yet, with the dazzling speed tech is entering in our daily lives, computers are becoming increasingly capable of doing human tasks. Time to set our computer fear aside and start to learn what “computers” can bring us. Let´s start with logic. It seems extremely hard to understand a computer, but actually, a computer is not (yet) that smart. Learn to understand computer programming, like algorithms & flowchart, with everyday routines. Here we go!
ALGORITHM
It sounds simply too complicated to be able to understand, so many people not even try it in the first place. Too bad, for algorithms can be complicated, but its definition is easily understandable with a bit of common sense.
An algorithm is “any limited sequence of computer-instructions or steps to solve a specified problem in a logic matter to perform a computer task successfully.”
Quite understandable, right?
Everyday routine examples
Our brain is already working like a well-wired computer. Each day when we wake up, live our lives and prepare ourselves for sleeping, we execute a fixed amount of limited steps to complete our daily routines. The thing is: we are mostly unaware, as we perform these routines automatically.
EVERYDAY ROUTINE ALGORITHM EXAMPLE 1: “Drink your Coffee”
- Take a coffee pad.
- Put it in the coffee machine.
- Check if the coffee machine is turned on. __If not, turn the machine on.
- Check if the water filter is full enough. — If not, add water.
- Put a coffee mug under the coffee dispenser.
- Press the coffee button.
- The coffee is being served. — Wait for the machine to indicate when the coffee is ready.
- If the coffee is ready — Take the coffee mug out of the coffee machine.
- Add milk and sugar. — If you wish.
Congratulations! Your “Drink Your Coffee” algorithm is ready! Let´s make a second algorithm.
EVERYDAY ROUTINE ALGORITHM EXAMPLE 2: “Wash Your Hands”
- Open the water tap.
- Put soap on your hands.
- Clean your hands with water.
- Shut down the water tap.
- Dry your hands.
Again, Congratulations! Your “Wash Your Hands” algorithm is ready! So, here you are: you have just created two algorithms of everyday routines. Quite doable, right?
FLOWCHART
As you can see in the “Drink your Coffee” algorithms example, an algorithm can not be solved without a specific ordering of steps. Instead, to solve any everyday routine problem consciously, the structures or steps to solve the problem are “conditional”. If A, then B. If B then C. Only in this way you can create a complete algorithm to solve a specific everyday routine problem.
Every step you take will consist of two possible outcomes for 1 specific action. This is in short where a flowchart comes in handy.
EVERYDAY ROUTINE EXAMPLE 3: “Put the light of a lamp on” algorithm.
Question: How do we check if the lamp works or not?
Start Situation: The Lamp doesn´t work.
Step (Conditional) 1: CHECK if the light of the lamp is switched on.
- No= Switch the light on.
- Yes= go to the next conditional.
Step (Conditional) 2: CHECK if the lightbulb is in order.
- No= Replace the lightbulb for a new one.
- Yes= go to the next conditional.
Step (Conditional) 3: Does the lamp function?
- No= Replace the lamp with a new one.
- Yes= problem is solved!
In this example you see how an everyday routine algorithm can easily be solved with specific (conditional) steps. The order of the step is important for the algorithm problem to get solved. It will not work in any other order. A flowchart is the graphical presentation of the specific process or algorithm.
As a programmer, you need to give specific instructions to a computer, in order to let the computer “understand” what (conditional) steps it needs to process to get a specific problem solved. This is simply said how computers work! See, Algorithms and Flowcharts aren´t that hard to understand after all. It is all quite logical!