This commit is contained in:
Miloslav Ciz 2025-02-26 18:17:24 +01:00
parent f80ca20c00
commit 1e739cc555
19 changed files with 1980 additions and 1936 deletions

View file

@ -226,8 +226,9 @@ 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. 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?
122. What does constant [bitrate](bitrate.md) mean in relation to video encoding? What are some of its advantages and disadvantages against variable bitrate?
123. Write the hexadecimal values of a pure green color in 24 bit RGB, [RGB565](rgb565.md) and [RGB332](rgb332.md) formats.
124. Did you enjoy this quiz?
### Answers
@ -353,8 +354,9 @@ 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. 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
122. Constant bitrate means a given time unit of the video will always be encoded with (at least approximately) the same number of [bits](bit.md). One second of the video will therefore take the same size no matter how complex or simple the encoded scene is. Advantages are for example being able to estimate size of any video just from its duration alone, easier seeking and rewinding to a random position, or that during streaming over network there will be a constant number of bits transferred per second, which is very predictable and good for many protocols. Disadvantage may be that sometimes space is wasted (we encode a simple scene with more bits than necessary) and that quality of the video won't be constant (scenes for which bits don't suffice will have to have their quality lowered).
123. 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.
124. yes
## Other