# Computer Science Distilled

## Metadata
- Author: [[Wladston Ferreira Filho]]
- Full Title: Computer Science Distilled
- Category: #general-computing
## Highlights
- When you’re on a complex task, keep your brain at the top of its game: dump all important stuff on paper. ([Location 118](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=118))
- pseudocode expresses computational processes. Pseudocode is human-friendly code that cannot be understood by a machine. ([Location 140](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=140))
- A model is a set of concepts that represents a problem and its characteristics. ([Location 164](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=164))
- Mathematically described models have a great advantage: they can be adapted for computers using well established math techniques. If your model has graphs, use graph theory. If it has equations, use algebra. ([Location 167](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=167))
- Quadratic equations are important for you as a pressure cooking pot is valuable to cooks. They save time. Quadratic equations help us solve many problems faster. ([Location 184](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=184))
- Dependency between variables is expressed with →, the conditional operator. A → B is the idea that A = True implies B = True: ([Location 203](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=203))
- Every conditional expression has a contrapositive equivalent: ([Location 214](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=214))
- beware of the inverse error: never presume B → A follows from A → B. ([Location 228](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=228))
- A truth table has a column for each variable. Rows represent possible combinations of variable states. ([Location 315](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=315))
- Whenever you’re dealing with things that assume one of two possibilities, remember they can be modeled as logic variables. ([Location 354](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=354))
- Logic gates perform logic operations on electric current. ([Location 359](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=359))
- A modern CPU is just a circuit of millions of microscopic wires and logic gates that manipulate electric currents of information. ([Location 379](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=379))
- If we have n items, we can order them in n factorial (n!) different ways. The factorial is explosive, it gets to enormous numbers for small values of n. ([Location 404](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=404))
- When the outcome of an event does not influence the outcome of another event, they are independent. The probability that two independent events will happen is the product of their individual probabilities. ([Location 506](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=506))
- If you need any of the mutually exclusive events to happen, just sum their individual probabilities. ([Location 516](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=516))
- When two mutually exclusive events cover all possible outcomes, they are complementary. ([Location 525](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=525))
- • The 20% chance of hitting is complementary to the 80% chance of missing. The probability that all towers miss is: 0.85 ≈ 0.33. • The event “all towers miss” is complementary to “at least one tower hits”. The probability of stopping the enemy is: 1 − 0.33 = 0.67. ([Location 532](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=532))
- Past events never affect the outcome of an independent event. Never. Ever. In a truly random lottery drawing, the chances of any specific numbers being chosen is the same as any other. ([Location 539](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=539))
- A method is a list of unambiguous instructions for achieving a goal. A method that always requires a finite series of operations is called an algorithm. ([Location 599](https://readwise.io/to_kindle?action=open&asin=B0731JG96F&location=599))