[1.1] What are algorithms? Can you think of some examples of them in your daily life?
Solution: Algorithms are procedures that specify the steps one needs to take to complete a task or solve a problem. They are used to standardize processes and communicate them between different people. Some examples of algorithms include recipes, tax codes, and sewing patterns.
[1.2] What are the core parts of an algorithm? (Hint: there are 3!)
Solution:
Specify what is needed at the beginning (the input)
Specify what is produced at the end (the output)
Specify how to get from the beginning to the end (the steps)
[1.3] What is abstraction? Can you think of an example of abstraction from the real world or from the computing world?
Solution: Abstraction is a technique used to make complex systems manageable by changing the amount of detail used to represent or interact with the system. Examples include credit cards, debit cards, cash, coins, venmo, etc. which are ways to abstract money.
[1.4] Write a step-by-step algorithm at a low level of abstraction for making a cup of noodles. Assume you have access to all the ingredients i.e., chopsticks, cup noodles, hot water, the sauce packets, etc. Break down the process into clear, simple instructions that someone can follow if they have no prior knowledge of utensils and ingredients and what each item is, how to use them and in which order.
Solution:
Define chopsticks as thin wooden sticks that come in a pair.
Define a book as a small, heavy object made out of a wood material.
Define cup noodles as a small container made out of plastic that is filled with a dried doughy substance inside of it.
Define hot water as a clear liquid that is hot and stored in a container.
Define sauce packets as small plastic containers that contain flavored liquid.
First, with one hand grasp the hot water container. Move it adjacent to the cup noodles but slightly above it.
Tilt the container so that the hot water starts to fall within the cup noodles container. Stop tilting and return to normal position when the water reaches the top edge of the cup noodles.
Move the hot water container and place it down in its original location.
Use one hand to grasp a book and place it on top of the cup noodle container.
Wait 5 minutes.
Use one hand to grasp the book and return it to its original position.
Use two hands to rip a corner off of the sauce packet. Orient the sauce packet such that the cut is facing the cup noodles container and is above it.
Squeeze down on the packet.
Move packet to the side and use one hand to pick up chopsticks.
Move chopsticks into the cup noodles container and move them around for 30 seconds.
[1.5] Now write the same algorithm but at a medium level of abstraction. They have knowledge about each of the ingredients and how to use the given items but not how to make the noodles.
Solution:
Pick up the hot water and pour some into cup noodles container until the water reaches the edge of the container.
Place a book on top of the cup noodles container and leave it there for five minutes.
Remove the book and tear a corner of the sauce packet.
Squeeze the sauce packet into the cup noodles.
Use chopsticks to stir the noodle along with the sauce for 30 seconds.
[1.6] Now write the same algorithm but at a high level of abstraction.
Solution:
Add some hot water to the noodles to cook them.
Once cooked, add and mix sauce packets into the noodles.