Update
This commit is contained in:
parent
b82dd9c6da
commit
c863684c6d
10 changed files with 1856 additions and 1736 deletions
10
exercises.md
10
exercises.md
|
@ -153,7 +153,9 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
|
|||
50. Is [LGBT](lgbt.md) [good](good.md)?
|
||||
51. Write a [C](c.md) function in 60 characters or fewer that takes a string (`char *`, consider zero terminated ASCII string) and replaces all semicolons in it with colons (`;` -> `:`). It can return nothing (`void`).
|
||||
52. Order the following [people](people.md) by date of their birth from oldest: [Alan Turing](turing.md), Caesar, [Buddha](buddha.md) (Siddhartha Gautama), Johannes Gutenberg, Aristotle, [Charles Babbage](babbage.md), [Linus Torvalds](torvalds.md), [Jesus](jesus.md), [Adolf Hitler](hitler.md), Muhammad (prophet of Islam), [Albert Einstein](einstein.md), [Richard Stallman](rms.md), Napoleon, Leonardo da Vinci, [Karl Marx](marx.md).
|
||||
53. Did you enjoy this quiz?
|
||||
53. State at least 5 reasons for why [Rust](rust.md) sucks so much.
|
||||
54. Find at least one function *f(x)* that's defined for all non-negative integers and for which it holds that *x + f(x) - f(x + 1) = 0*. (It's enough if you show a sequence of numbers with obvious continuation.)
|
||||
55. Did you enjoy this quiz?
|
||||
|
||||
### Answers
|
||||
|
||||
|
@ -166,7 +168,7 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
|
|||
7. The relationship is commonly described like this: information is interpreted data. I.e. data is just a sequence of symbols, information is the knowledge we extract from it.
|
||||
8. The probability of program breaking is 1 minus probability of it not breaking. For a program to NOT break during one year, all libraries have to stay unchanged (probability 0.95 for each one): that's 0.95 * 0.95 * 0.95 * ... = 0.95^10. Similarly the probability of it not breaking during 5 years is (0.95^10)^5, so the probability of the program breaking in 5 years is around 92%.
|
||||
9. `e`
|
||||
10. Original Unix (around 1970), MS DOS (1981), Windows (1985), Linux (1998), TempleOS (2007). Linux stands out because it's not an operating system, it's a kernel.
|
||||
10. Original Unix (around 1970), MS DOS (1981), Windows (1985), Linux (1998), TempleOS (2007). Linux stands out because it's not an operating system, it's a kernel (alternative answers are possible, for example TempleOS is the only software here developed by a single man).
|
||||
11. 80085
|
||||
12. third
|
||||
13. *2 * N*. We can multiply the greatest values: *(2^N - 1) * (2^N - 1) = 2^(2 * N) - 2^(N + 1) + 1*; The greatest term *2^(2 * N)* in binary is 1 with *2 * N* zeros after it, subtracting *(2^(N + 1) - 1)* will always definitely shorten this number by at least one bit (1000... minus anything non-zero will shorten the number). So at most we will need *2 * N* bits for the result, but we can't use fewer because for example 11 * 11 = 1001 -- in this case fewer than 2 * 2 = 4 bits wouldn't suffice. So in general we need *2 * N* bits.
|
||||
|
@ -209,7 +211,9 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
|
|||
50. hell no
|
||||
51. For example: `void r(char *s) { while (*s) s += (*s -= *s == ';') != 0; }`;
|
||||
52. Buddha (< -480), Diogenes (-404), Aristotle (-384), Caesar (-100), Jesus (around -5), Muhammad (around 570), Gutenberg (around 1400), Da Vinci (1452), Napoleon (1769), Babbage (1791), Marx (1818), Einstein (1879), Hitler (1889), Turing (1912), Stallman (1953), Torvalds (1969).
|
||||
53. yes
|
||||
53. For example: it's bloated, slow, can't be compiled on good computers, it's tranny software with toxic fascist community, it has issues with legal freedom (trademarks), it has [code of censorship](coc.md), it has no specification, it's obsessed with "safety", the name is complete shit, it is associated with [corporations](corporation.md), has some abomination of [OOP](oop.md), it's littered with dependencies, it's [capitalist monopoly software](capitalist_software.md), it's trying to display [C](c.md), it is hosted on [GitHub](github.md), the users are and devs idiots and so on and so forth.
|
||||
54. We can rewrite the condition as *f(x + 1) = f(x) + x* from which it's clear that the next number in the sequence is the previous one minus its position (a bit similar to [Fibonacci](fibonacci.md) sequence), so for example this sequence will satisfy the equation: 0, 0, 1, 3, 6, 10, 15, ...
|
||||
55. yes
|
||||
|
||||
## Other
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue