Update
This commit is contained in:
parent
638265b6fe
commit
07603f7b64
14 changed files with 1975 additions and 1933 deletions
|
@ -334,7 +334,7 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
|
|||
99. Cache is a small memory placed between the CPU and main memory (RAM), it is a very fast type of memory, faster than the main memory, but it's also much smaller than main memory. The idea is that programs typically do a lot of work in some small region of main memory, they keep reading and writing the same (or nearby) memory cell(s) over and over and only after a while move somewhere else. So once the program starts a work in some memory area, the cache can load that area, let the program do its work very quickly in the cache, and then (when the program moves elsewhere) copy the results back from the cache to the memory. It's similar to downloading a file from the Internet to the disk, then editing the file locally and later on uploading it back. However the cache will be effective only if the assumption we made hold, i.e. if the program really mostly works in small areas of memory and makes minimum of long jumps, so if a program wants to fully utilize the cache, it should try to minimize these long jumps (for example by putting related data close to each other).
|
||||
100. There is no correct answering with either "yes" or "no" (this is therefore the correct answer). The question can be reworded as: *Is "yes" the wrong answer to this question?*, neither yes or no (or both at once) work as an answer: answering "yes" leads to a contradiction (by giving "yes" as a correct answer we'll imply it's actually the wrong answer) and answering "no" would imply "yes" is the correct answer (which we've proven to not work).
|
||||
101. BENIS
|
||||
102. [Floating point](float.md) had decreasing precision towards higher values, this one if already beyond the resolution of 1, so the float type cannot represent this number plus one, adding one rounds the result down to the same number.
|
||||
102. [Floating point](float.md) has decreasing precision towards higher values, this one is already beyond the resolution of 1, so the float type cannot represent this number plus one, adding one rounds the result down to the same number.
|
||||
103. no
|
||||
104. We can't replace *a^(b/c)* with *(a^b)^(1/c)* if *a* is negative, that equation doesn't generally hold.
|
||||
105. { I hope this is right :D ~drummyfish } First imagine the graph of a polar coordinate function that says the radius of a plain circle with radius *r* depending on angle: the graph is just constant function (horizontal line) with value *r* going from 0 to *2 * pi*. Integrating this function (from 0 to 2 * pi, here we simply multiply *r* by *2 * pi* as the graph is a rectangle) will give us the formula for the circumference of circle: *2 * pi * r* -- we'll take this largely on intuition but it can be seen that this holds because we're adding constant tiny increments of length from 0 to what we know is the circle circumference (2 * pi * r). Now imagine similar function, just starting at *r1* and linearly increasing to *r2*, i.e. we just have a linear function saying the spiral radius for current angle. Again, we'll integrate this, this time getting (bottom rectangle plus upper right triangle): *2 * pi * r1 + 2 * pi * (r2 - r1) / 2*. Simplifying this we get *pi * (r1 + r2)*, which is hopefully the solution (we see this will be between the circumferences of the smaller and larger circles, also for *r1 = r2* we again get the circumference of plain circle etc.).
|
||||
|
@ -351,7 +351,7 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
|
|||
116. Should be 1792 { Unless I counted it wrong lol. ~drummyfish }. We can count this by just considering each square on the board and summing all possible queen and knight moves from that square (queen and knight together cover all possible moves). Queen can obviously end up on any square and from knight's walk we know we can place a knight anywhere as well. This can probably be computed even manually but writing a quick program does the job quicker.
|
||||
117. The term "second world" used to exist -- during the Cold War "first world" was used for the "western world", countries allied with US/NATO; the "second world" meant the "USSR world", and "third world" everyone else. After dissolution of Soviet Union the second world basically stopped existing, or rather merged with the first world, and since then the terms got more of an economical meaning rather than political.
|
||||
118. Two miners were coming down but only one up, more workers were entering the mine than were leaving, so the workers started to pile up in the mine. Cimrman solved this by advising the workers to eat a lot before the shift and then work hard to lose some weight so that two heavy miners would be able to lift two lighter ones.
|
||||
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)).
|
||||
119. a XOR b = (a AND NOT(b)) OR (NOT(a) AND b) = (a AND (b NAND b)) OR ((a NAND a) AND b) = NOT(a NAND (b NAND b)) AND ((a NAND a) NAND b) = (a NAND (b NAND b)) NAND ((a 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. 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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue