Some of My Probability Notes
Continuous Distributions Basic Definitions PDF ($f(x)$): \(P(X \in B) = \int_B f(x)dx, \quad P(a \le X \le b) = \int_a^b f(x)dx\) Properties: $f(x) \ge 0$ and $\int_{-\infty}^{\infty} f(x)dx = 1$...
Continuous Distributions Basic Definitions PDF ($f(x)$): \(P(X \in B) = \int_B f(x)dx, \quad P(a \le X \le b) = \int_a^b f(x)dx\) Properties: $f(x) \ge 0$ and $\int_{-\infty}^{\infty} f(x)dx = 1$...
Leetcode 2435. Paths in Matrix Whose Sum Is Divisible by K Intuition Step1: subproblem. This can be 3D DP: $DP[i][j][k]$ indicate the #(routes) from $[0,0]$ to $[i,j]$ with value k. Then the goa...
Leetcode contest I took Leetcode contest yesterday, Biweekly 168 and Weekly 473. I solve 3 in Biweekly and 2 in Weekly, and I get TLE/MLE on rest questions. At least, I got bad idea, it’s much b...
I will give all examples in ascending order, just change the judgement clause when you need descending order. $O(n^2)$ sorting algorithms Selection Sort The idea is, always select the smallest v...
LeetCode Problems 208. Implement Trie (Prefix Tree) 211. Design Add and Search Words Data Structure 212. Word Search II In previous problem, you should use DFS instead of BFS, or you will TLE. ...
Example 1 Never write: [[0] * 5] * 10 this clause you can only use once, [0] * 5, like this. But if you use [[0] * 5] * 10 instead of [[0]*5 for _ in range(10)], that will make your variable sh...
Very short conclusion: at least two traversal can uniquely a tree from the traversal, and one must be inorder traversal.
The problems come from the book A First Course in Probability by Sheldon Ross. But I am really sorry since I forgot where the solution I saw, maybe another book, Wikipedia, or maybe some other onli...
Personally, I believe the iPhone 17 is the most worthwhile option in the new series. Released on September 9, 2025, the iPhone 17 brings a significant balance between price and performance, much li...