AP CSP 3.15 Exercise 1: Read the Random Rolls

Big Idea 3 · Topic 3.15 · Exercise 1

Read the Random Rolls

25 minutes

Back to the Topic 3.15 lessonAll CSP topics

How this page works

The writing boxes below are yours. What you type stays in this browser, is saved here as you go, and is never sent to us or to your teacher. Hand the written work in the way your teacher asked for it.

The graded check at the bottom is the part that records to your teacher's gradebook.

Part B, from your handoutNot recorded

Your handout says these are the same items available here. Part A stays on paper.

Q1 · 3 points on the handout

Before GameNight picks an event with RANDOM(1, 3), a player asks, 'which event will it choose?' Explain what you CAN say for certain and what you CANNOT, using the words 'set of possible results' and 'each execution.'

Q2 · 3 points on the handout

A tester must verify that the die NEVER returns 0 or 7 - only 1 through 6. Since the die's value changes every run, printing the raw roll gives no fixed answer to check. Describe what PROPERTY the test program should print instead, and why that output is predictable.

Q3 · 2 points on the handout

ENRICHMENT: GameNight wants a random EVEN bonus of 2, 4, 6, or 8. A student writes bonus <- RANDOM(2, 8) and is surprised to see 5 appear. Explain why, and design a correct expression using RANDOM plus arithmetic.

Q4 · 0 points on the handout

Next step: you determined these possible results by hand. Now head to the Topic 3.15 page and type and run the harder versions, where the computer checks a property of each random result for you.

No graded check on this page yetNot recorded

About the line in your handout

Your handout says this exercise is available online and auto-graded. The exercise IS here, and it is the same work in the same order, but the auto-graded half is not written for this topic yet. Nothing on this page is scored or sent to your teacher.

Hand this in the way your teacher asked for it. Topic 1.1 has its graded check today, and the rest follow.

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]