Skip to content
All categories

learning

345 posts

Why an Explicit Free List Lives in Two Orders at Once | Stanford CS107 Lecture 22

CS107 Lecture 22 replaces an implicit list with an explicit free list. Searches visit only reusable blocks, but every free block now has both physical neighbors and logical links, so unlinking, coalescing, and reinsertion must preserve both structures.

A Pointer Is Not Magic, but a Copyable Address | Stanford CS107 Lecture 8

CS107 Lecture 8 starts with address-of and dereference, explains why C pointer parameters are still passed by value, and shows how int *, char *, and char ** can modify caller-owned ints, chars, and pointers respectively.

An Array Is Not a Pointer, but They Cooperate in Expressions | Stanford CS107 Lecture 9

CS107 Lecture 9 uses seven C-string rules to separate array objects, pointer variables, and string literals: arrays often convert to first-element pointers in expressions, but storage, assignment, mutability, and sizeof remain different.

After Reverse Engineering, Ask About Privacy and Trust Before Building a Heap Allocator | Stanford CS107 Lecture 20

CS107 Lecture 20 places reverse-engineering capability in an ethical context: privacy has individual and social models, while trust combines reliance with a risk of betrayal. It then reviews process memory and shifts from heap-allocation client to allocator implementer.

Stack vs. Heap Is About Lifetime and Ownership, Not Just Speed | Stanford CS107 Lecture 10

CS107 Lecture 10 moves from sizeof and pointer arithmetic to stack-frame lifetime: returning a local array leaves a dangling pointer; malloc crosses function returns but makes NULL handling, size arithmetic, ownership, free, and leaks the programmer's responsibility.

Wrap-up, Six Systems Questions, and What Comes Next | Stanford CS107 Lecture 26

CS107 Lecture 26 closes ten weeks through six big questions: representation, text, memory, generics, execution, and allocation. It checks the learning goals through the explicit allocator and points toward CS111 and other systems courses.

What is Probability?: List outcomes first; only then assign probabilities to events. | Stanford CS109 Lecture 1

List outcomes first; only then assign probabilities to events.

Conditional Probability: A condition restricts the sample space to outcomes still compatible with the evidence. | Stanford CS109 Lecture 2

A condition restricts the sample space to outcomes still compatible with the evidence.

Bayes Theorem: Bayes’ theorem turns an easier generative direction into the inferential direction we need. | Stanford CS109 Lecture 3

Bayes’ theorem turns an easier generative direction into the inferential direction we need.

Counting and Combinatorics: Decide whether order matters and repetition is allowed before choosing a formula. | Stanford CS109 Lecture 4

Decide whether order matters and repetition is allowed before choosing a formula.

Random Variables and Expectation: A random variable maps outcomes to numbers; expectation is a weighted average, not necessarily an attainable value. | Stanford CS109 Lecture 5

A random variable maps outcomes to numbers; expectation is a weighted average, not necessarily an attainable value.

Moments: Expectation, LOTUS, and linearity | Stanford CS109 Lecture 6

Expectation compresses a distribution into a weighted average; LOTUS handles transformed values, while linearity makes sums tractable even without independence.

Variance and Poisson: From spread to rare-event counts | Stanford CS109 Lecture 7

Variance describes a random variable's spread; Poisson models counts in a fixed interval and approximates a large-n, small-p binomial.

Continuous Random Variables: PDFs, CDFs, Uniform, and Exponential | Stanford CS109 Lecture 8

A continuous variable assigns zero probability to a point and area to intervals; CDFs, Uniform, Exponential, and memorylessness build on that distinction.

Normal Distribution: Standardization, Phi, and continuity correction | Stanford CS109 Lecture 9

Standardization maps Normal variables to Z; Phi, linear transforms, and continuity correction turn intervals and large binomials into computable probabilities.

Probabilistic Models: Joints, marginals, independence, and Bayes | Stanford CS109 Lecture 10

A joint distribution retains the full relationship among variables; marginals, conditionals, independence, and Bayes extract different answers from it.

Inference: Prior times likelihood, then normalize | Stanford CS109 Lecture 11

Inference multiplies each hidden-variable prior by an observation likelihood and normalizes; the same loop handles repeated evidence and discretized continuous beliefs.

General Inference: Bayesian networks, sampling, and rare evidence | Stanford CS109 Lecture 12

A Bayesian network factorizes a huge joint through conditional independence; ancestral sampling generates joint samples, and rejection sampling filters them into a conditional.

Multinomial: Category counts, bag of words, and log probability | Stanford CS109 Lecture 13

The Multinomial extends two-category Binomial counts to many categories; the same PMF models documents as word counts for Bayesian authorship with log-scores.

Beta: Turn an unknown probability into an updatable random variable | Stanford CS109 Lecture 14

A Beta distribution represents full belief about an unknown success rate; success/failure data updates two parameters for posteriors, smoothing, and Thompson-sampling decisions.