Square\text{Square}

About\text{About}: (a+b)r(a+b)^r

$$(a+b)^r=a^r+(C_r^1)a^{n-1}b^1+(C_r^2)a^{n-2}b^2+(C_r^3)a^{n-3}b^{3}+\dots+(C_r^{n-2})a^2b^{n-2}+(C_r^{n-1})a^1b^{n-1} $$

Set\text {Set}

88 bit\texttt{bit} location\text{location}

Condition\text {Condition} A\text A : "11" start\text {start} 272^7

Condition\text {Condition} B\text B : "0000" last\text {last} 262^6

AB=A+B+AB|A\cup B|=|A|+|B|+|A\cap B|

Ring multiplication principle\text{Ring multiplication principle}

$\text {At a round table, there are four people seated, and if in both seating arrangements, everyone's left and right neighbors are the same, how many ways are there to think the same?}$

Configurages=4!4\texttt{Configurages}=\frac {4!}{4}

Binomial theorem\text {Binomial theorem}

i=0n2i(Cni)=(2+1)n=3n\sum_{i=0}^{n}{2^i}\cdot(C_n^i)=(2+1)^n=3^n

Examples of complexity\text{Examples of complexity}

#include <iostream>
#include <bitset>

using namespace std;

int main() {
    int s = 9;
    for (int i = s; ; i = (i - 1) & s) { // s is a set.
        cout << bitset<8>(i);
        if (i == 0) {
            break;
        }
    }
}
/*
a subset of 9:
1001
0001
1000
0000 *
*/

The time complexity is\text{The time complexity is}

i=0n2i\sum_{i=0}^{n}2^i\cdot

Plus find the complexity\text{Plus find the complexity}

#include <iostream>
#include <bitset>

using namespace std;

int main()
{
    int sum = 0;
    int n = 5;
    for (int s = 0; s < (1 << n); s++) {
        for (int i = s; ; i = (i - 1) & s) {
            cout << bitset<8>(i) << '\n';
            sum++;
            if (i == 0) {
                break;
            }
        }
    }
    cout << sum << '\n';
    return 0;
}

Yang Hui triangle\text{Yang Hui triangle}

1 1
1 2 1
1 3 3 1
1 4 6 4 1
...
Cnm=Cn1m1+Cn1mC_n^m=C_{n-1}^{m-1}+C_{n-1}^m

Yang Hui triangle diagram\text{Yang Hui triangle diagram}

杨辉三角图

Combinatorics\text{Combinatorics}

VANDERMONDE’S IDENTITY\text {VANDERMONDE'S IDENTITY} $\text {Let m, n, and r, be nonnegative integers with r not ex-ceeding either m or b. Then}$

Cm+nr=k=0rCmrkCnkC_{m+n}^r=\sum_{k=0}^{r}C_m^{r-k}C_n^k

$\text {COROLLARY If n is a nonnegative integer. Then}$:

C2nn=k=0n(Cnk)2C_{2n}^n=\sum_{k=0}^{n}(C_n^k)^2

$\text {THEOREM Let n and r be nonnegative integer with } r\leqslant n \text {. Then}$

Cn+1r+1=j=rnCjiC_{n+1}^{r+1}=\sum_{j=r}^{n}C_j^i

The principle of repulsion\text {The principle of repulsion}

$\text{A probabilistic form of the repulsion principle}$:

$$P(A\cup B)=P(A)+P(B)-P(A\cap B) P(A\cup B\cup C)=P(A)+P(B)+P(C)-P(A\cap B)-P(B\cap C)-P(A\cap C)+P(A\cap B \cap C) $$

Probability\text{Probability}

Fundamental theorem:\text {Fundamental theorem:}

$$P(A)=1-P(\overline A) \\ P(\phi)=0 \\ \text {If } A \subset B, \text {So} P(A)\leqslant P(B) \\ \text {To any event: } 0\leqslant P(A)\leqslant 1 $$

Discrete probability\text{Discrete probability}

Formula\text{Formula}

$$\text {Probability} (\%)=\frac {\text{Number of valid scenarios}}{\text{Total number of scenarios}} $$

Expectation\text {Expectation}:

$\text {Defined as: a weighted average weighted by probability (or density).}$

E[X]=xXxP(x)\text E [X]=\sum_{x\in X} xP(x)

Classical generalization\text{Classical generalization}

Example:\text{Example:}

$\text{There are 4 red balls and 6 black balls in the bag, which are now placed in the bag Return to the ground to take the ball 3 times in turn, and find the probability of getting the black ball for the first 2 times and the red ball for the 3rd time.}$

Theorem:\text{Theorem:}

  • If the random event is satisfied:\text {If the random event is satisfied:}
  1. $\text {Limited sample space: The number of sample points is limited.}$
  2. And other possibilities,\text{And other possibilities,} $\text{Each basic event has the same probability of occurring.}$
    • $\text{Ideally, the probability of any one side facing up is equal when a die is rolled.}$
  • The test is a classical generalization\text {The test is a classical generalization}.
  • Event A’s Probability\text {Event A's Probability} P(A)=ASP(A)=\frac {|A|}{|S|}

Geometric generalizations\text{Geometric generalizations}

Example:\text{Example:}

$\text{At 0 moments, two people are waiting for the bus, car A arrives with a probability of arriving at the first 60 minutes, and car B arrives with an equal probability of arriving at the first 120 minutes. Ask about the probability that car A will arrive before car B.}$

Math Expectations\text{Math Expectations}

$\text {Let the random variable } X \text {have the pmf}$

f(x)=13xSxf(x)=\frac{1}{3}\\ x\in S_x

$\text{where } S_x={-1,0,1}\text{ Let } u(X)=X^2\text{. Then}$

$$E(X^2)=\sum_{x\in S_x}x^2f(x)=(-1)^2(\frac{1}{3}) + (0)^2(\frac{1}{3})+(1)^2(\frac{1}{3})=\frac{2}{3} $$

Segma ’s Quality\text{Segma } \sum \text{'s Quality}

Plus quality:\text{Plus quality:}

$$\sum{(a_i+b_i)}=\sum{a_i}+\sum{b_i} \\ \sum{(a_i-b_i)}=\sum{a_i}-\sum{b_i} $$

Frac quality:\text{Frac quality:}

ab=1ba\sum{\frac{a}{b}}=\frac{1}{b}\sum{a}

Cycle’s segma quality:\text{Cycle's segma quality:}

$$\sum_{cyc}{a}=\sum_{cyc}{b}=\sum_{cyc}{c}=a+b+c \\ \sum_{cyc}ab=\sum_{cyc}bc=\sum_{cyc}{ca}=ab+bc+ca \\ \sum_{cyc}a^2b=\sum_{cyc}b^2c=\sum_{cyc}c^2b=a^2b+b^2c+c^2a $$