Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP CSP – Big Idea 2 - Data

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

A computer program represents a pixel’s color using three 8-bit numbers: red, green, and blue values. For example, the color (0, 0, 255) represents pure blue. What is the binary representation of the RGB triplet (120, 15, 200)?

a)

(01111000, 00001111, 11001000)

b)

(11110000, 11111111, 11001111)

c)

(10000000, 00001111, 11001001)

d)

(01111000, 11110000, 11001000)

2.

The decimal number 225 is stored as an 8-bit binary number. Which of the following is the correct binary representation?

a)

11100001

b)

11011101

c)

11100000

d)

11110001

3.

A program stores the result of the calculation 0.1 + 0.2 as 0.30000000000000004. Which best explains this?

a)

Overflow error occurred.

b)

The precision of the result is limited due to the limited amount of bits.

c)

The computer used integer addition instead of floating-point addition.

d)

The addition was performed in reverse order.

4.

An application needs to represent 30 unique symbols using binary sequences. What is the smallest number of bits needed per symbol?

a)

3

b)

4

c)

5

d)

6

5.

In which situation is lossy compression more appropriate than lossless compression?

a)

Storing a medical X-ray image to be examined by doctors

b)

Compressing photos to fit more photos onto a smartphone's memory

c)

Archiving important government legal documents for future access

d)

Saving a high quality raw image file for professional editing

6.

A computer compresses a spreadsheet file and later restores it to the exact original version without losing any numbers. Which type of compression is demonstrated?

a)

Lossy compression

b)

Lossless compression

c)

Overflow error

d)

Approximation

7.

A student wants to send a folder of documents from her school iPad to home computer. Which of the following situations best demonstrates the use of lossless compress of the original files?

a)

Her iPad compresses the documents before sending it to her home computer. Her home computer restores the compressed files to their original quality before she uses them.

b)

Her iPad compresses the documents by removing details that are not needed for her school project. The compressed documents are then sent to her home computer which she will use to interact with the documents.

c)

Her iPad sends the original documents to her home computer. Her home computer removes metadata before she uses the files for her project.

d)

Her iPad sends the original documents to her home computer and she goes home to interact with the sent files as is.

8.

Byte pair encoding replaces repeated pairs of characters with unused symbols. For example, "THIS_IS_THE_BEST_WISH" can be encoded as "%#_#_%E_BEST_W#H" with % mapping to "TH" and # mapping to "IS".

Which string CANNOT be shortened using byte pair encoding?

a)

“LOOPY_BALLOONS”

b)

“GUITARS_ROCK”

c)

“TATTOO_ATTACK”

d)

“MESSY_SUCCESS”

9.

A computer uses 8 bits to represent integers (maximum value = 255). What happens if the program computes 200 + 100?

a)

The program produces 300 without error.

b)

An overflow error occurs.

c)

A round-off error occurs.

d)

The result is automatically stored as a floating-point number.

10.

A smartphone photo includes:

Pixel data (colors for each pixel)

Metadata (date, time, GPS location)

For which purpose would metadata be more useful than pixel data?

a)

Counting how many people are in the image

b)

Identifying whether the picture is of a dog or a cat

c)

Determining where the photo was taken

d)

Finding the dominant color in the image

11.

A fitness app collects the following information from runners: the date, time, distance run, and GPS route.

Which of the following questions CANNOT be answered using only this data?

a)

How many miles a runner covers in a week

b)

Which neighborhoods the runner usually trains in

c)

Whether the runner’s pace varies between weekdays and weekends

d)

Whether the runner typically runs with music playing

12.

A video streaming service records both the number of videos watched per day and the average length of each viewing session. After releasing a “short clips” feature, the number of daily views increased, while the average session length decreased.

Which hypothesis best matches this data?

a)

The feature caused users to stop using the service.

b)

Users became less likely to log in at all.

c)

The feature prevented new accounts from being created.

d)

Users are watching more short clips instead of longer videos.

13.

A programmer wants to create an algorithm that returns the last digits of all even numbers from a list, sorted from smallest to largest.


For example, from [23, 40, 17, 82], the output should be [0, 2].

The programmer has identified the following steps:
I. Keep only even numbers
II. Extract last digits
III. Sort in ascending order

Which order of steps will achieve the desired result?

a)

I → II → III

b)

II → I → III

c)

III → I → II

d)

II → III → I