📝 Notes
93 articlesOne transcript, five GPAs: weighted averages and working back to a target
The same sample transcript yields five GPAs from 2.943 to 3.394 under five schemes: per-course credit weighting, simple average, weighted average score and arithmetic average. This note also works back to how far a target GPA is.
3,000 a month for 20 years: compound versus simple interest and the rule of 72
With 100,000 principal plus 3,000 a month at a nominal 4% for 20 years, this note compares compound, simple and beginning-versus-end-of-period contributions, measures the rule of 72 error at each rate, and writes out the logarithm.
Up 10% then down 10% loses money: bases, percentage points and stacked discounts
Up 10% then down 10% leaves 99.0000%, and two successive discounts do not simply add. This note uses a break-even drop table to separate three measures, the percentage base, percentage points and cumulative change, and gives a way to check the result.
sin(pi) returns 0.0548, not 0: degrees, radians and calculator precedence
The screen shows sin(pi) = 0.0548036651488 instead of 0. This note separates mode, expression syntax and double-precision representation, with a raw-versus-shown table and a checklist for factorials, precedence and precision limits.
Why one ad campaign shows up as two rows: UTM parameters, case and encoding
Why does one batch of campaign links produce two rows in a report? This note checks real character counts across the five utm parameters, same-name parameters overwriting rather than appending, percent-encoding bloat for Chinese and spaces, and parameter order changing the string.
What is inside the three parts of a JWT: reading header, payload and exp
Taking over a login API, a packet capture yields only three strings: when does it expire, and what does role contain? This note decodes a sample section by section, with character counts, byte counts and UTC times, and explains the difference between encoding and signing.
Which part of a URL reaches the server? Six parts, %20, + and double encoding
This note splits a URL into scheme, host, port, path, query and fragment, then uses local tests to show that fragments stay in the browser, plus signs mean spaces, and double encoding leaves percent signs after one decode.
Why the last digit of a Chinese ID is sometimes X: weighted modulo 11
Why does X appear at the end of a Chinese ID number? This note gives the full algorithm in three steps: 17 weights, modulo 11 and a lookup table, plus the boundary where a check digit catches typos but not fabrication.
Equal instalments versus equal principal: a month-by-month comparison on a 1M, 30-year loan
On a 1,000,000 principal over 30 years, this note compares equal-instalment and equal-principal repayment at 3.0% and 3.5%: monthly payment, total interest, monthly decrease, which period the cumulative totals cross at, and how much a 20-year term saves.
What you actually take home from a 10,000 yuan salary: thresholds, brackets and quick deductions
How much tax comes out of a 10,000 yuan monthly salary? Using a 5,000 yuan standard deduction, this note works through the seven progressive brackets, the quick-deduction recurrence and cumulative withholding, and explains why the number does not match your payslip.
How many hosts fit in a /22? Host bits, network and broadcast addresses
Why do 256 addresses support only 254 hosts? This note shows how host bits, the network address and the broadcast address subtract from the total, with a /16 to /30 block table and mask conversion method.
Fraction addition and subtraction: seeing every step of the common denominator
When tutoring fraction addition, where the common denominator comes from, when to reduce, and why mixed numbers do not take part: this note works through 3/4+5/6 and 5/8-1/6 step by step on both routes.