【Informatics I】Chapter 3: Computers and Programming Study Notes

Hello everyone! In this chapter, we are going to explore "how computers work" and the "basics of programming." This is a super important topic that appears frequently on the Common Test!
Some of you might feel that "programming seems difficult," but it’s actually just about "organizing steps and asking the computer to carry them out." Let's learn it step by step in a fun way!

1. How Computers Work (Hardware)

Computers are broadly divided into "hardware" (the physical components you can see) and "software" (the invisible programs).
First, let's learn the foundations of hardware: the "Five Major Components of a Computer!"

The Five Major Components of a Computer

Computer operation is often compared to "cooking."

  • Control Unit: Issues instructions to the whole system (Head Chef)
  • Arithmetic and Logic Unit (ALU): Performs calculations and comparisons (The cook)
  • Storage Unit: Saves data (Cutting board / Refrigerator)
  • Input Unit: Inputs data (The mouth that brings in ingredients: Mouse, Keyboard)
  • Output Unit: Produces results (The plate serving the finished dish: Display, Printer)

【Key Point】
The CPU (Central Processing Unit) is the "brain" of the computer, combining the "Control Unit" and the "ALU" mentioned above. When this part is fast, your computer runs smoothly!

【The Difference in Storage Devices】
There are two types of storage devices:
1. Main Memory (RAM): A place to temporarily store the data currently in use. It is cleared when the power is turned off. (The size of a desk for working)
2. Auxiliary Storage (HDD, SSD, etc.): A place to save photos and documents permanently. Data remains even after the power is turned off. (The capacity of a filing cabinet drawer)

💡 Tip: If you run out of memory, the computer feels like "the desk is too small to work on!" and it starts running slowly.

(Section Summary)
Computers work through the cooperation of the "Five Major Components"! Remember: the CPU is the "brain," and memory is the "temporary workspace!"

2. Software and OS

Instructions that make hardware move are called software.

OS (Operating System)

The OS is the "basic software" that manages the entire computer. Windows, macOS, iOS, and Android are famous examples.
Thanks to the OS, we can operate computers by touching screens or moving a mouse without having to write difficult commands ourselves.

Apps (Application Software)

These are programs used for specific purposes, such as spreadsheet software, web browsers, and social media apps.

3. Basics of Algorithms

An algorithm is a "procedure for solving a problem."
A "recipe for curry" or the "steps to buy tea from a vending machine" are perfectly valid algorithms!

Three Basic Structures of Algorithms

No matter how complex a program is, it is actually built from just these three combinations:

  1. Sequence: Executing steps in order from top to bottom.
  2. Selection (Branching): If something happens, do A; otherwise, do B. (e.g., If the test score is 80 or higher, "Pass"; otherwise, "Fail")
  3. Repetition (Loop): Repeating until a condition is met. (e.g., Doing 10 squats)

【Common Mistakes】
Be careful when setting conditions for "Selection" and "Repetition." For example, when "counting to 10," deciding whether to end at 9 or include 10 is the "boundary", and being aware of this is the trick to successful programming.

(Section Summary)
Algorithms are made of "Sequence, Selection, and Repetition"! It is highly recommended to visualize the flow using flowcharts.

4. Basic Elements of Programming

Now, let's look at the core of programming. Here, we will explain based on the concepts of "Common Test Program Notation."

Variables

A variable is a "labeled box" for storing data.
The expression \( x = 10 \) means "x is equal to 10" in mathematics, but in programming, it means "put 10 into the box named x (assignment)."

Operations (Calculation Rules)

The symbols are slightly different from basic arithmetic.
・Addition: \( a + b \)
・Subtraction: \( a - b \)
・Multiplication: \( a * b \) (Use an asterisk!)
・Division: \( a / b \)
Remainder (Modulo): \( a \% b \) or \( a \mod b \) (← This is super important!)

【Key Point: Using Remainder】
If \( n \% 2 == 0 \), it means n is divisible by 2, so we can determine it is an "even number." This technique comes up on exams all the time!

Comparison and Logical Operations

・\( a > b \) : a is greater than b
・\( a == b \) : a and b are equal (usually represented by two equals signs)
・\( a != b \) : a and b are not equal
AND: True only when both conditions are met
OR: True when either condition is met

(Section Summary)
Variables are "boxes," assignment is "putting a value in a box," and the remainder calculation (%) is often used for "judging even/odd numbers!"

5. Modeling and Simulation

By using computers, we can test things digitally that would be difficult to experiment with in the real world.

Modeling

Extracting only the necessary parts from a complex real-world system is called modeling.
(e.g., To calculate the time spent standing in line, ignoring individual personality and only considering "average processing time.")

Simulation

Using a model to predict what will happen in the future.

  • Random Numbers: Generating numbers at random, like rolling dice. Using this allows us to recreate events that happen by chance.
For example, it is used when thinking about the spread of infectious diseases or solutions to reduce waiting lines at a register.

💡 Tip: Weather forecasting is also a giant simulation. Supercomputers perform massive calculations to predict tomorrow's weather.

(Section Summary)
Use "modeling" to simplify, and "simulation" to predict! Random numbers are essential for reproducing "chance!"

Finally...
At first, you might feel anxious, thinking "I can't read this code!" but that's perfectly okay. Start by grasping the big picture: "What does this program want to achieve?"
Writing small programs yourself or tracing the code (following the calculations line by line yourself) will help your understanding deepen all at once! I'm rooting for you!