分类: 数学

数学的一般概念,介绍该知识的目的不是为了写代码。

组合数

2026年2月2日

从n个不同元素中取出k个元素的所有不同组合的个数,叫做组合数。组合数有许多种(相反的)记法:\(C_n^k,\; C_k^n,\; \binom{n}{k}\)。本文采用上大下小的记法。 \(\binom{n}{k}\)的计算方式如下: 若\(n\geqslant k \geqslant 0\),则 […]

How to calculate pass@k

2026年2月1日

pass@k本质上是计算组合数。标准公式是一个取反公式:\(1-\frac{\binom{n-c}{k}}{\binom{n}{k}}\), assuming \(\binom{n}{k}\) means choosing k from n. And c is the number of corre […]

Methods of proof

2025年8月2日

premise p and conclusion c Direct proof Prove \(p \to c = \neg p \vee c = T\). If we stick with direct proof, the expression to prove must have an out […]

Prove properties of abelian groups

2025年6月4日
A group is a non-empty set G together with a binary operation on G, here denoted “\(\cdot\)”, that combines any two elements a and b of G […]

509. Fibonacci Number

2024年6月27日

The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding one […]

Prove the Euclidean Algorithm

2024年5月25日

本文将故意采用同余符号(\(a\equiv c\pmod b\)),让本文看起来酷炫一点。 When a and b are integers and \(b \neq 0\) we say “a divides b”, and write \(a|b\). In other […]

大数取模 modulo arithmetic

2024年5月18日

春季美墨边境有3500位走线移民者,法院至少接受1位,至多接受全部的避难申请。请问总共有多少种接受方法?注意:该数字很大,只需要写出该数字除以\(10^9+7\)的余数。 解答: 每个走线者,要么被接受要么不被接受,有2种可能。所以有\(2^{3500}\)种可能。但不能所有人都不被接受,所以答案是 […]

随机变量的期望

2019年3月7日

离散型随机变量的数学期望 若离散型随机变量X的概率质量函数为f(x),则其期望为 \[ E(X)=\sum_i^n x_if(x_i) \] 例:伯努力分布的数学期望 设Z服从伯努力分布,求Z的数学期望。 解: 伯努力分布是两点分布,可知其概率质量函数为 \[ f(x)=\begin{cases} […]

矩阵梯度

2019年3月7日

首先定义函数[latex]f:R^{m \times n} \rightarrow R[/latex],也就是函数f的输入是一个m行n列的矩阵,输出是一个数值。 那么函数 f(A) 的梯度就是对A中的每一个元素求偏导数得到的矩阵(也就是说梯度是一个矩阵): \[ \nabla_X f(X) = \b […]