← Student page The Polar Bear Game

Welcome to computer science

The Polar Bear Game

Today's goal: discover a hidden system by observing, testing, and explaining.

Listen for clues

The riddle of the ice

Polar bears, they come in pairs.
They sit around the hole in the ice
like petals around a flower.

How many bears?

Fish swim in a hole.
Look below.
Take control.

How many fish?

Fish eat plankton, so they hang out where the fish are not.
They travel in groups of seven.
Try multiplying the spots.

How many plankton?

Partner challenge

Figure out the rules

1

Observe

Write only what the dice show.

2

Hypothesize

Propose three separate rules.

3

Test

Choose a roll that could disprove a rule.

4

Refine

Revise using evidence, not guesses.

Use physical dice or the digital challenge. Do not search for the answer.

Test your algorithm

Game challenge

Reveal after investigation

What is beneath the ice?

Holes

Odd faces have a center pip: one hole.

Bears

Count the pips around an odd face's center.

Fish

Fish are hidden on the face beneath each ice hole. Imagine turning the die over to count them.

Plankton

On even faces: visible pips multiplied by 7.

Discuss before we code

Can you state each rule precisely?

Ice holes

Which top faces contain a center hole? How could an algorithm recognize those faces?

Polar bears

When a hole is present, how can the top value determine the number of surrounding bears?

Fish

How can you determine the hidden bottom value using only the odd top face?

Plankton

When no hole is present, how do the visible spots determine the plankton count?

Be ready to describe each rule as a calculation or an if/otherwise decision.

From pattern to program

Turn the rules into an algorithm.

For each die, make one decision.

Odd faces follow the hole branch. Even faces follow the plankton branch.

holes ← 0
bears ← 0
fish ← 0
plankton ← 0

FOR EACH die
  IF die is odd
    holes ← holes + 1
    bears ← bears + (die - 1)
    fish ← fish + (7 - die)
  ELSE
    plankton ← plankton + (die × 7)

CS connection · 1 of 5

Pattern recognition

AP CSP Practice 1 · Computational Solution Design · Skill 1.A
Investigate the situation, context, or task.

Definition: Pattern recognition is identifying similarities, trends, or relationships that repeat across examples.

Connection to the game: You compared multiple rolls and noticed that the same kinds of faces repeatedly produced holes, bears, fish, or plankton. Those repeated relationships became evidence for your rules.

CS connection · 2 of 5

Decomposition

AP CSP Practice 1 · Computational Solution Design · Skill 1.B
Determine and design an appropriate method or approach to achieve the purpose.

Definition: Decomposition is breaking a complex problem into smaller, more manageable problems that can be solved separately.

Connection to the game: Instead of solving the entire mystery at once, you separated it into four questions: Where are the holes? How are bears counted? Where are fish? How are plankton counted?

CS connection · 3 of 5

Abstraction

AP CSP Practice 3 · Abstraction in Program Development · Skill 3.B
Use abstraction to manage complexity in a program.

Definition: Abstraction simplifies a problem by focusing on relevant information while hiding or ignoring details that do not affect the solution.

Connection to the game: The die's color, location, and rotation did not matter. You represented each die with the information the solution needed: its top value, whether that value was odd or even, and its hidden opposite value.

CS connection · 4 of 5

Algorithm

AP CSP Practice 2 · Algorithms and Program Development · Skill 2.B
Implement and apply an algorithm using sequencing, selection, and iteration.

Definition: An algorithm is a finite, ordered set of precise steps used to complete a task or solve a problem.

Sequence

Instructions performed in a specific order. Game: initialize totals, examine a die, apply its rule, then update a total.

Selection

A decision that chooses which instructions run. Game: use one branch for odd faces and another for even faces.

Iteration

Repeating instructions. Game: apply the rule to each die in the roll.

CS connection · 5 of 5

Testing and debugging

AP CSP Practice 4 · Code Analysis · Skill 4.C
Identify and correct errors in algorithms and programs, including error discovery through testing.

Definition: Testing runs a solution with chosen inputs and compares the result with what was expected. Debugging locates the cause of an error and corrects it.

Connection to the game: You predicted totals for a new roll and checked the result. When a prediction failed, you found the assumption that did not fit the evidence, revised the rule, and tested again.

Where this course is going

AP Computer Science Principles

Five Big Ideas

  1. 1Creative Development
  2. 2Data
  3. 3Algorithms and Programming
  4. 4Computer Systems and Networks
  5. 5Impact of Computing

Computational Thinking Practices

  1. 1Computational Solution Design
  2. 2Algorithms and Program Development
  3. 3Abstraction in Program Development
  4. 4Code Analysis
  5. 5Computing Innovations
  6. 6Responsible Computing

Exit reflection

Make your thinking visible.

What did your group believe at first?

What evidence changed or strengthened your idea?

How was this process similar to debugging a program?

Keep testing your hypothesis

The original poem

Polar bears

Polar bears, they come in pairs.
They sit around the hole in the ice
like petals around a flower.

How many polar bears do you see?

Fish

Fish swim in a hole.
Look below.
Take control.

How many fish are in the sea?

Plankton

Fish eat plankton, so they hang out
where the fish are not.
They travel in groups of seven.
Try multiplying the spots.

How many plankton?