Practice Simulation in CS Thinking
Use these practice problems to test your method after reviewing the concept explanation and worked examples.
Quick Recap
Using a computer program to model and experiment with a real-world system or process. Simulations represent key variables and their relationships mathematically, allowing you to test scenarios, make predictions, and explore outcomes without real-world cost or risk.
A virtual experimentβtest ideas without real-world consequences.
Showing a random 20 of 50 problems.
Example 1
challengeA logistic model , . Compute to 2 decimals.
Example 2
hardA flight simulator passes all known test scenarios but a real plane crashes when a flap fails. What was the model missing?
Example 3
easyA dice-roll simulation outputs 1,3,5,2,6 across 5 trials. Estimated mean roll?
Example 4
mediumA simulation predicts a bridge holds 10 tons, but the real bridge fails at 6. What should you do before trusting future predictions?
Example 5
easyWhy run a simulation instead of the real experiment?
Example 6
hardA dice-rolling simulation generates random numbers 1-6 to simulate rolling a die 1000 times. Why might the simulated results differ from the theoretical probability (1/6 each)? What would make them converge?
Example 7
mediumTwo simulations start identically but one uses step size 1.0 and the other 0.5 (half steps, twice as many). Which generally tracks reality more closely?
Example 8
easyIf a simulation's assumptions are wrong, are its predictions reliable?
Example 9
easyA simulation of a flipped coin generates a number 0 or 1. To estimate , what should you do with the outputs?
Example 10
mediumA simulation's predictions diverge from reality after step 100. What is most likely the cause: random noise or compounding model error?
Example 11
mediumA traffic simulation models cars on a road. Each car has a speed and position. Every second, each car moves forward by its speed, unless the car ahead is too close (then it slows down). What simplifications (abstractions) does this simulation make?
Example 12
mediumAn SIR disease model tracks , , counts. Which simplification trades realism for tractability: (a) homogeneous mixing, (b) tracking each individual home address?
Example 13
hardTwo integration step sizes: gives error ; what error do you expect at for a first-order method?
Example 14
easyWhy might engineers simulate a rocket launch before building one?
Example 15
easyA simulation steps once per timer event. What programming style does it rely on?
Example 16
challengeA climate model is run with two different seeds, yielding diverging trajectories after 50 years. How do scientists extract a useful prediction?
Example 17
hardA Monte Carlo estimator uses samples and has error . To halve error, how many more samples are needed?
Example 18
easyA dice simulation should produce values in what range for a standard die?
Example 19
easyA simulation uses with . What is ?
Example 20
easyWhich is an abstraction a traffic simulation might make: (a) cars are points, (b) every license plate is modeled?