This commit is contained in:
Miloslav Ciz 2025-01-11 20:07:14 +01:00
parent 9347555db9
commit 884594926a
17 changed files with 1909 additions and 1865 deletions

View file

@ -226,7 +226,8 @@ Bear in mind this is not a school test that's supposed to decide if you get to a
119. Use only the logical function [NAND](nand.md) (which gives a negated result of [AND](and.md)) to implement the [XOR](xor.md) logical function.
120. We have a rubber rope 1 meter long. On one side there is an ant. He starts moving over the rubber towards its other end by the speed of 1 cm/s, however as he starts to move we start stretching the rubber also by the speed of 1 cm/s, so that after 1 second it's 101 cm long, after 2 seconds it's 102 cm long etc. The ant keeps the same speed. Will he ever reach the end? How long would it take him?
121. Today in [slavery](work.md) I tried to fix 6 computers: I ended up destroying twice as many of them than I fixed. Every time I destroyed a computer my boss told me I'm a retard. How many times did my boss repeat I'm a retard?
122. Did you enjoy this quiz?
122. Write the hexadecimal values of a pure green color in 24 bit RGB, [RGB565](rgb565.md) and [RGB332](rgb332.md) formats.
123. Did you enjoy this quiz?
### Answers
@ -352,7 +353,8 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
119. a XOR b = (a OR b) AND NOT(a AND b) = ((a NAND a) NAND (b NAND b)) AND (a NAND b) = (((a NAND a) NAND (b NAND b)) NAND (a NAND b)) NAND (((a NAND a) NAND (b NAND b)) NAND (a NAND b)).
120. Let *p* be the ant's relative position on the rubber, i.e. the fraction of the rubber he has already traveled; when *p = 1* he'll be in the finish. At the beginning his speed in fractions of the rubber per second is *v = 1/100*. As the rubber expands, the fractional speed decreases (he keeps moving at 1 cm/s but the total number of cm to be traveled increases): we can write the speed as a function of time: *v = 1/(100 + t)*. Now the fractional position *p* over time is an [integral](integral.md) of speed, i.e. *p = integrate 1/(100 + t) dt = log(100 + t) + C* and the initial position is *p = 0*, i.e. *C = -log(100)*, so *p = log(100 + t) - log(100)*. Now we just have to compute when *p* reaches 1, i.e. *log(100 + t) - log(100) = 1*, which gives us *t = 100 * (e - 1) ~= 171.83*. So the ant will reach the end in nearly 3 minutes.
121. 3: I destroyed 4 computers, so he told me 4 times I'm a retard, i.e. he first told me I'm a retard (this was not a repetition) and then repeated it three times.
122. yes
122. 24 bit RGB is easy: 00ff00. For 565 we want a 16 bit value whose upper and lower 5 bits are zero, with the middle bits being ones, i.e. 0000011111100000 in binary, which is 07e0 in hexadecimal. Similarly for 332 we get 1c.
123. yes
## Other