Computer Science
Math Concepts We Should Know
Geometry
Mystery Questions
100

Yosef wants to keep track of a player's current amount of money in a roblox game he is making. What should he use to tell the computer to store that information?

A variable called playerMoney (or similar name). Either an int or a float will work

100

if the units we are using to measure shapes are meters, area is measured in meters ______ed and volume is measured in meters _______ed

squar/cub -> meters squared/meters cubed

100

How much paint (in square feet) is required to paint the front face of a door whose base is 2.5 feet and whose height is 6 feet?

area = base * height = 2.5 feet * 6 feet = 15 square feet of paint

100

Who was the president before Barack Obama? (2004-2008)

George W Bush

200

Azi is trying to store the username of a player in his game. He writes the line of code

username == "Azi"

and then tells the computer to 

print(username), but his computer gives him an error telling him that username has no value. What does Azi need to fix to make his code run properly?

Azi used the equality operator "=="  when he meant to use assignment operator "="

200

What does PEMDAS stand for and how do we use it?

Parentheses: ()

Exponents: 2^2

Multiplication/Division: *, /

Addition/Subtraction: +,-

You simplify expressions like (2+5)*2/3^2 in that order

200

Nachi wants to compute the area of a circle with radius 2 meters, so he says:

- the area formula is A = pi * r^2 and r is 2

- so take pi * 2 = 6.18, where pi is approximately 3.14

- then square it to get the area 38.19 square meters (he checked his squaring calculation is correct with a calculator)

Fictional Nachi is incorrect. Why?

Nachi did not pay attention to PEMDAS/order of operations, which tells us that we evaluate Exponents before Multiplication. 

He should have squared 2 before multiplying by pi

200

How many is two pairs twice?

2*2*2 = 2^3 = 8

300

What is

reverse(reverse(reverse(reverse(reverse(reverse(reverse(reverse(reverse(reverse("a man a plan a canal panama")))))))))) == to?

a man a plan a canal panama

300

When subtracting in columns, how do we borrow from a 0?

borrow from the number to its left to make the 0 a 10, then proceed as usual

300

Polygon (a closed, non-curved shape) ABCD has:

1. two parallel sides AB and CD that are not the same length.

2. two lines AD and BC that are not parallel

What shape is polygon ABCD? And what is its area formula?

Hint: Draw it!

Polygon ABCD is a trapezoid. If we let b1=AB and b2=CD, and let h be the height of the trapezoid, its area is A = (b1+b2)h/2

300

There is one country whose flag is not rectangular. Which country is it?

Nepal

400

Ari is coding a NBA 2K game and is storing the names of the Bulls starting 5 players as a list of strings:

players = ["Josh Giddey", "Lonzo Ball", "Coby White", "Ayo Dosunmu", "Nikola Vucevic"]

Lonzo Ball just made a basket, so Ari wants to display that. He writes the list selection

displayName = players[2] (because he wants to access the 2nd string in the list)

to access his name and store it in the variable displayName. Ari is making a small mistake. What would you tell him to help fix it?

Hint: What is the "first" number in CS?

players[1] == "Lonzo Ball", since array indices start at 0, and so does counting in CS. players[2] is "Coby White", not "Lonzo Ball"

400

Which of the 4 operations +, -, *, /, are commutative?

+ and *:

a+b = b+a

a*b = b*a

but for all numbers a,b:

a - b != b - a 

a/b != b/a 

400

Triangle ABC has an area of 20 square feet. Line segment BC is 8 feet long. What is the height of the triangle, measured from vertex A to its base?

Hint: What formula relates triangle area, base and height?

Let's call the height h. 

Line segment BC is the base b = 8

Explanation 1 (H):

Then Area = 20 = bh/2 = 8h/2

We can multiply both sides by 2, then divide by 8 to get h = 5 ft

Explanation 2 (R): 

We know that 8 times the height divided by 2 is 20. This is the same question as 4 times the height is 20. The only number that the height could be that makes that statement true is 5, since 4*5=20. Therefore the height is 5 feet.

400

A bag contains marbles in 3 colors: red, blue, and green.

Without looking, what is the minimum number of marbles you need to remove from the bag to guarantee that you will get 2 of the same color?

4.

removing 3 marbles might get 1red, 1blue, 1green, but then we are out of 'new' colors, so the 4th marble must be a color we have already chosen

500

Suppose  

str1 = "xaw"

str2 = "_o" 

str3 = "ff"

str4 = "n_"

str5 = "the_"

What the value of secretMessage below?

secretMessage = reverse(str1) + str2 + reverse(reverse(str4))  + reverse(str1)  + str2 + str3

"wax_on,_wax_off"

500

Explain what the distributive property of multiplication is

a(b+c) = ab + ac. The multiplication of a distributes over the addition of b and c, for any 3 numbers a,b,c.

500

 The angle at which pac-man's mouth opens is 30 degrees. Aside from the missing part where his mouth is open, he is a perfect circle of radius 2 cm. What is the area of pacman in square cm? 

Hint: If a circle is made of 360 degrees and 30 of them are missing, what fraction of the circle is still there? This is the same fraction of the amount of area that is still there.

30/360 = 1/12 of the circle is missing. Alternatively, 330/360 = 11/12 of the circle is still there. 

So we can take 11/12 of the area of a full circle:

11/12 * pi * r^2 = 11/12 * pi * 2^2 = 11/12 * pi * 4 = 4*11/12 *pi = 1*11/3 * pi = 11/3 * pi square cm

500

Manny's password consists of  4 english letters A-Z or a-z. If a hacker does not guess the same wrong password twice, what is the maximum number of guesses they have to make in order to crack Manny's password?

Hints:

- When we have A ways to choose something and B ways to choose another thing, we have A*B ways to choose them together.

break the password down into 4 'slots' where a letter can go

- how many letters can Manny chose from to put in one slot? 

Each of the 4 letter slots can be one of 26 uppercase english letters or 26 lowercase letters, so each slot can be one of 52 letters.

Since there are 52 ways to choose slot 1, 52 ways to choose slot 2, 52 ways to choose slot 3, and 52 ways to choose slot 4. We can multiply each number of choices together:

52*52*52*52 = 52^4 

So it will take a hacker a maximum of 52^4 = 7,311,616 guesses to crack Manny's password.