In this blog post, I will explain how kimchi stew and algorithms are similar and interesting from the perspective of clear and efficient problem solving.
How to make kimchi stew? An algorithm!
How do you make kimchi stew?
1. Put water in a pot and boil it.
2. Add an appropriate amount of well-seasoned kimchi and boil.
3. When it is cooked, season it to taste and finish.
If you explain it this way, most people will be so angry that they will throw a question mark. But strictly speaking, the above explanation is not the way to make kimchi stew. It’s just that there are a lot of ambiguous points, but it’s not a completely wrong statement. This explanation is part of the problem-solving process. The method of systematically explaining the problem-solving process is called an “algorithm.”
What is an algorithm?
An algorithm is a step-by-step procedure or method for solving a problem. The kimchi stew recipe mentioned above is also a type of algorithm. However, it cannot be called a “well-designed algorithm.” A well-designed algorithm is a procedure that is clear, efficient, and includes a logical explanation that can be applied to all situations.
Clarity of algorithms
A clear algorithm means that there is no confusion and no ambiguity for the reader to understand. For example, the expression “appropriate amount” mentioned above is very ambiguous. This is not a clear explanation because each person may have a different interpretation of the appropriate amount. To create a clear algorithm, it must be specified.
Let’s express the recipe for kimchi stew a little more clearly.
1. Put 500-550 ml of water (at 4°C) in a pot and boil it.
2. Cut the kimchi into squares or rhombuses with a side length of about 3 cm, and then boil it with 40 g of kimchi per 100 g of water.
3. When the kimchi is cooked, season it and finish it.
In this way, the use of specific numbers instead of the vague expression “appropriate amount” can increase the clarity of the algorithm. “Clarity” is essential here. This is because clear standards and steps must be presented in order to achieve consistent results, just as the process of making kimchi stew is not interpreted differently by each person.
The efficiency of the algorithm
The algorithm should be not only clear but also efficient. In other words, it is important to minimize the time and resources required to solve a problem. In computer science, in particular, the processing time can vary greatly depending on the efficiency of the algorithm when the size of the input is very large.
For example, the details of the algorithm may not make much difference when making a single bowl of kimchi stew, but the story is different when hundreds of bowls of kimchi stew need to be made. This is because the time it takes to complete the dish varies greatly depending on what is considered “appropriate preparation” and how long it takes to prepare it.
Algorithms and everyday life
In computer science, algorithms are used to solve various problems in our lives. A typical example is an algorithm that finds the shortest route in a car navigation system. The shortest route must be found quickly by taking into account various variables such as real-time traffic conditions, accidents, and average speed on the road. To solve such problems, a very efficient and clear algorithm is needed.
Algorithms are being applied in various places that we have not thought of in our daily lives. For example, Internet search engines use algorithms to quickly and accurately find the information we want among the vast amount of information. Algorithms also play an important role in sorting large amounts of data or filtering them according to specific criteria. The purpose of algorithms is to solve problems quickly and accurately.
Real-world application of algorithms
In reality, algorithms are not just academic concepts. We use algorithms in many cooking recipes and in the process of solving everyday problems. For example, just as the most ideal taste can be achieved when the right combination of ingredients, cooking time, and order are followed precisely in the process of making kimchi jjigae, algorithms exist to provide optimal solutions in various problem situations.
Not only in computer science, but also in many aspects of our lives, we often unconsciously follow algorithms. We solve problems through a set of procedures and steps, and in the process, we improve the algorithm based on our experience.