
Grade 12 · 18 weeks
Computer Science
Build and test a Lantern Festival scorer, model data, and design a program that people can use without giving up unnecessary personal information.
Start Week 12Term 2 · Data, networks and computing impacts
Modeling relationships with data
A computational model turns a relationship into rules that can generate predictions. Toy data can test the code. Observations from a separate sample help evaluate whether the model is useful.
Read-aloud is not available in this browser. You can still read this text on screen.
Computing lab
The starter predicts tokens from rounds. Use four collected counts from an approved nonpersonal activity, or use the supplied pairs (1, 2), (2, 3), (3, 6), (4, 7) of rounds and tokens. Compare model errors and test a revision on a fifth observed or instructor-supplied pair.
Keep for review. Model code, a predicted-versus-observed table, an error comparison and a limitation.
JavaScript starter code
Save this example as a .js file and run it in Node.js or an editor your educator approves.
function predictTokens(rounds) {
return rounds * 2;
}
for (const [rounds, observed] of [[1, 2], [2, 3], [3, 6], [4, 7]]) {
const predicted = predictTokens(rounds);
console.log(rounds, observed, predicted, observed - predicted);
}Plan the week
- Read the lesson and explain its main idea in your own words.
- State the system or program’s goal and sketch its inputs, rules and output.
- Complete the investigation and keep the evidence listed above.
- Test or trace a second case and record any change it suggests.
- Answer the week’s check, then explain your reasoning using your evidence.

