5. Option Topic Bank

Option B: Modelling And Simulation

Option B: Modelling and Simulation

Introduction: Why model the real world? 🌍

students, in computer science we often want to understand systems that are too large, too dangerous, too slow, or too expensive to study directly. A weather system, a traffic network, the spread of a virus, or the loading of a website can be impossible to test in real life again and again. That is where modelling and simulation help.

A model is a simplified representation of a real situation, object, or process. A simulation uses a model to imitate how that system behaves over time. In IB Computer Science SL Option B, you study how computers help us make, test, and improve models so we can predict outcomes and make better decisions.

By the end of this lesson, students, you should be able to:

  • explain the key ideas and terms in modelling and simulation,
  • apply reasoning to simple simulation problems,
  • connect this topic to other parts of the Option Topic Bank,
  • and use examples to show how models support real-world decision-making.

A good model is not a perfect copy. Instead, it keeps the important parts and leaves out details that do not matter for the purpose. That is the big idea behind modelling and simulation đź’ˇ

What is a model? Two useful ways to think about it

A model is built for a specific purpose. Different purposes need different models.

For example, imagine a school cafeteria. If the goal is to predict how long students will wait in line at lunchtime, the model may include the number of students, the number of serving counters, and the time each student takes to order. It does not need details like what color the walls are or what music is playing, because those do not affect waiting time.

Models can be:

  • physical models, like a small bridge made for testing,
  • mathematical models, like equations used to predict growth or movement,
  • computer models, which use software to represent the system digitally.

In IB Computer Science, computer models are especially important because they can be changed quickly and run many times. This lets us explore “what if?” questions. What if the cafeteria opens one more counter? What if the average service time drops by $10\%$? What if twice as many students arrive at once? A model helps answer such questions before anyone changes the real system.

A model also has to be valid for its purpose. That means it should represent the important parts of the real system well enough to be useful. A model of traffic flow for city planning does not need every individual driver’s personality, but it does need realistic road capacity, traffic light timing, and vehicle arrival rates.

Simulation: running the model over time

A simulation is when the model is used to imitate the system’s behavior. Instead of only describing a system, a simulation shows what happens step by step.

This is useful because many real systems involve change over time. For example:

  • the number of customers entering a shop changes minute by minute,
  • the spread of a disease changes day by day,
  • the number of packets in a network changes second by second.

A simulation can help answer questions such as:

  • How many staff members are needed?
  • What is the chance of a queue becoming too long?
  • How often might a server crash under heavy demand?

Computers are ideal for simulation because they can repeat calculations quickly and handle large amounts of data. In many simulations, time is broken into steps. For each step, the program updates the state of the system.

For example, in a simple queue simulation:

  1. new customers arrive,
  2. the system checks whether a service desk is free,
  3. waiting customers move forward,
  4. the queue length is updated.

This repeated process continues until the simulation ends.

Key terminology in Option B

To succeed in this topic, students, you should know several important terms.

A system is a set of parts working together to perform a task or produce an outcome. Examples include a bank, a school timetable, or a road network.

A state describes the current condition of a system at a particular moment. In a queue model, the state might include the number of people waiting, the number being served, and the current time.

An input is something that enters the model, such as arrival rate, customer behavior, or initial values. An output is the result produced by the simulation, such as total waiting time or average queue length.

A variable is a quantity that can change. For example, the number of cars on a road can be written as $n$, and the average arrival rate may be written as $\lambda$.

A parameter is a value used by the model that usually stays fixed during one run, such as the number of service counters or the speed limit.

A random variable is a variable whose value depends on chance. In many simulations, randomness is essential because real life is unpredictable. For example, customer arrivals may not happen at exact regular intervals.

A probability distribution describes how likely different outcomes are. In a simulation, a distribution can be used to generate random events that match real-world patterns.

Why randomness matters 🎲

Many real-world systems are not completely predictable. Even if we know the rules, we may not know exactly what will happen next. That is why simulations often include randomness.

For example, suppose a call center receives an average of $20$ calls per hour. The exact number in one hour may be $17$, $21$, or $24$. A simulation may use random numbers to create realistic arrival times.

Randomness makes simulations more realistic, but it also means one run may not tell the whole story. That is why simulations are often repeated many times. The results can then be averaged to find a more reliable estimate.

For instance, if a traffic simulation is run $100$ times, the average waiting time is more useful than a single result. This is because one run might be unusually busy or unusually quiet.

In IB Computer Science terms, this idea helps explain why simulation is a tool for estimation rather than exact prediction. A model may give a strong best estimate, but it cannot guarantee the future.

Building and testing a simulation

When creating a simulation, the process usually includes these stages:

  1. Define the problem

Decide what question the model should answer.

  1. Identify important factors

Choose the parts of the real system that matter most.

  1. Create the model

Represent the system using rules, variables, and relationships.

  1. Implement the simulation

Write code or use software to run the model.

  1. Test and verify

Check that the simulation works as intended.

  1. Validate

Check that the model is a good representation of the real situation.

The difference between verification and validation is important:

  • Verification asks, “Did we build the model correctly?”
  • Validation asks, “Did we build the correct model?”

A program can be verified as working properly, yet still be a poor model of the real world if it ignores important factors.

For example, a simulation of emergency room waiting times might work perfectly as code, but if it ignores arrival surges during flu season, it may not be valid for long-term planning.

Example: simulating a cafeteria queue 🍔

Let’s use a simple example, students.

A school cafeteria has one serving counter. Students arrive at random times, and each service takes about $2$ minutes on average. The school wants to know whether long queues will form during lunch.

A simulation might use these variables:

  • arrival time of each student,
  • service time per student,
  • number of counters,
  • queue length,
  • waiting time.

If the arrival rate is higher than the service rate, the queue will grow. If we write arrival rate as $a$ and service rate as $s$, then:

$$a > s$$

means the queue tends to grow over time.

If the school adds another counter, the service rate increases. The simulation can compare two scenarios:

  • one counter,
  • two counters.

After many runs, the school may find that the average waiting time falls from $18$ minutes to $6$ minutes. That kind of evidence helps with planning and budgeting.

This is a powerful example of how modelling and simulation support decisions using data instead of guesses.

Strengths, limitations, and ethics

Simulations are useful, but they have limits.

Strengths:

  • They are safer than testing dangerous real-world situations.
  • They can be cheaper than building full-scale systems.
  • They allow repeated testing under different conditions.
  • They help predict trends and compare options.

Limitations:

  • They depend on assumptions.
  • They may be inaccurate if important details are missing.
  • They can be misleading if users trust them blindly.
  • They may require good-quality data to be useful.

Ethical issues can also matter. If a model is used to make decisions about people, such as health care, transport, or employment, then poor data or biased assumptions can cause unfair results. students, this is why computer scientists must be careful when choosing data and interpreting outcomes.

A simulation should always be treated as support for decision-making, not as magical truth. The quality of the result depends on the quality of the model.

How this topic fits the Option Topic Bank

Option B belongs to the broader IB Computer Science SL Option Topic Bank, which includes specialized extension material chosen by the teacher. This means the topic goes beyond core computer science ideas and focuses on a particular area of application.

Modelling and simulation connect to many other parts of computer science:

  • Algorithms: simulations follow step-by-step rules.
  • Data representation: the model depends on variables, inputs, and outputs.
  • Programming: simulations are often written as programs.
  • Problem-solving: models help test solutions before real-world action.
  • Computational thinking: students break a complex system into manageable parts.

So, students, this option is not only about running computer experiments. It is about using computer science to understand systems, compare choices, and support real decisions.

Conclusion

Modelling and simulation are essential tools for studying complex systems. A model simplifies reality so we can focus on what matters, and a simulation lets us test how that model behaves over time. In Option B, you learn key terms such as system, state, variable, parameter, verification, and validation, along with the important role of randomness and repeated trials.

The main idea is simple but powerful: when real-life testing is difficult, expensive, or risky, computer-based simulation gives us a safe way to explore possibilities. Whether the system is a cafeteria queue, a traffic network, or a hospital waiting room, modelling helps us make better decisions using evidence.

Study Notes

  • A model is a simplified representation of a real system.
  • A simulation runs the model to imitate behavior over time.
  • Models are built for a specific purpose and should include only relevant details.
  • Common model types include physical, mathematical, and computer models.
  • Important terms include system, state, input, output, variable, parameter, and random variable.
  • Randomness is used because many real systems are unpredictable.
  • Simulations are often repeated many times to get more reliable results.
  • Verification checks whether the model was built correctly.
  • Validation checks whether the model is a good representation of reality.
  • If arrival rate $a$ is greater than service rate $s$, then queues tend to grow: $$a > s$$
  • Simulations are useful for safe testing, cost savings, and planning.
  • Limitations include assumptions, missing data, and possible bias.
  • Option B connects to algorithms, programming, data representation, and computational thinking.

Practice Quiz

5 questions to test your understanding

Option B: Modelling And Simulation — IB Computer Science SL | A-Warded