This commit is contained in:
Miloslav Ciz 2024-05-02 15:12:27 +02:00
parent a9e099e180
commit fab11be42b
11 changed files with 1777 additions and 1755 deletions

View file

@ -113,7 +113,7 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
10. Order the following software by the date of the release of their 1.0 version from oldest to newest: [TempleOS](temple_os.md), [MS DOS](dos.md), original [Unix](unix.md), [Linux](linux.md), [Windows](windows.md). Also point out which one stands out from others and why.
11. Please manually evaluate the following expression: (log2(64) - cos(0)) * (6! + 123) / (1 / 19).
12. If you're running in a race and overtake the guy who's currently in third place, what place will you be in?
13. When multiplying two *N* bit numbers (unsigned integers, direct representation), what is the minimum number of bits we will need to store their product? Prove it.
13. When multiplying two *N* bit numbers (unsigned integers, direct representation), what is the minimum number of bits we will generally (i.e. for any possible input numbers) need to store their product? Prove it.
14. We have two gears, each of same size and same number of teeth. Gear A is fixed in place, it can't move or rotate, gear B runs around gear A so that it keeps touching it (and therefore rotates along the way) until it gets to the place where it started. How many revolutions around its own axis (from your stationary point of view) has gear B made?
15. The sum of penis lengths of [Bill Gaytes](bill_gates.md) and [Steve Jewbs](steve_jobs.md) is 14 millimeters. Bill's dick is 4 millimeters longer than Steve's. What are their penis lengths?
16. What's the worst socioeconomic system in the world? You don't even have to say why because that would take too long.
@ -163,7 +163,10 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
60. What was the name of the computer that first beat the world [chess](chess.md) champion in an official match and in which year, with tolerance plus/minus 2, did it happen?
61. Consider the following set of numbers: 416, 81, 82, 69, 94, 28, 785, 44. Which of the following numbers belongs among them: 609, 11, 436, 88, 61 or 325?
62. As a programmer how would you represent a [set](set.md) that may contain integer numbers from 1 to 32 (including both)? What's the minimum number of bits you will need for storing this set? Additionally, how would you implement a multiset? I.e. what if you wanted to further allow any number in the set to potentially be present more than once (you can suppose an upper limit for this count at 255)? How many bits will you need then? Hint: set is much different from a list, for example order of its members doesn't matter.
63. Did you enjoy this quiz?
63. What's heavier, 20 kilograms of black hole or 30 kilograms of nothing?
64. We have a village of 27 people; in upcoming elections 17 want to vote for candidate A and 10 for candidate B. People will be divided into 3 districts, each with 9 people -- in each district one candidate will be picked by majority of votes, and then the candidate who wins in most districts will win the elections. Sort people into districts so that candidate B wins.
65. Some rich faggot got himself a house with opening roof -- it's a flat roof that after a button press will start to slide and so enlarge the hole in the roof linearly from 0 to 10 m^2 over 10 seconds. Closing is the same, just in opposite direction. Some idiot pressed the button during rain, the roof is opening and it's raining in the house all over his stereo and home cinema, he will close the roof but he can only do it once it has opened completely (so it will be raining inside for 20 seconds). The rain's intensity is such that 1 m^2 of area catches 1 litre of water in 1 second. When the roof has closed, how much water has poured into the room?
66. Did you enjoy this quiz?
### Answers
@ -229,7 +232,10 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
60. [Deep Blue](deep_blue.md), 1997
61. 436; in the original group each number's digits have a total count of closed loops equal to 2.
62. The most common and natural way is to use a [bit field](bit_field.md), i.e. an "array of bits" -- position of each bit is associated with an object that may potentially be present in the set and the bit's value then says if the object really is present or not. We want to be able to store 32 numbers, so we'll need 32 bits; the lowest bit says if number 1 is present, the next one says if number 2 is present etc. So we can really just use one 32 bit number to store this whole set. Implementing multiset is similar, we just allocate more bits for each potential member to indicate the count; in our case we suppose maximum value 255 so we can use 8 bits for each member (in C we would naturally implement this as an array of bytes), so we'll need 32 * 8 = 256 bits.
63. yes
63. I don't know lol. (That's the correct answer, it shows we can't know everything.)
64. District one: all A voters, district two and three will each have 5 B voters and 4 A voters.
65. The area of the roof hole says the rate at which the water pours in, we have to [integrate](integral.md) the hole area over the 20 seconds. We can split this to two parts that we'll add: from 0 to 10 seconds the function that says the area of the hole is simply *f1(t) = t*; from 10 to 20 seconds we can use a function *f2(t) = 10 - t* from 0 to 10 seconds. Integral of *f1* is *1/2 * t^2* which at *t = 10* gives us 50 litres; integral of *f2* is *10 * t - 1/2 * t^2* which also gives 50 litres (it's logical -- opening and closing of the roof is symmetric, same amount of water will fall in). So all in all there will be 100 litres of water in the room.
66. yes
## Other