帕斯卡三角
每个数等于上方两个数之和。帕斯卡三角编码了二项式系数、2 的幂以及取模着色下的分形图案。
5 分钟难度 1/3交互演示区域不展示广告。
Rows12 / 12Row sum2,048Center C(n, k)462Selected—
Every interior number is the sum of the two above it. Row n sums to 2ⁿ and contains the binomial coefficients C(n, k). Coloring by parity reveals the Sierpinski triangle; other moduli create related fractal patterns. The amber row is the latest one revealed.
你看到的是什么
1
三角形从 1 开始。每个内部数等于上方两个数之和。
2
第 n 行包含二项式系数 C(n, k),表示从 n 个物品中选 k 个的方法数。
3
按奇偶给数字着色会得到谢尔宾斯基三角形,按其他素数取模也会产生相关分形。
为什么重要
帕斯卡三角连接了代数、组合数学、概率和分形,出现在二项式展开、随机游走和元胞自动机中。
复杂度与细节
构造 n 行需要 O(n²) 次加法和 O(n²) 空间。
常见问题
为什么奇偶性会产生谢尔宾斯基图案?+
根据卢卡斯定理,当 k 的二进制位是 n 的二进制位的子集时,C(n,k) 为奇数。这个规则产生了分形图案。
第 n 行之和是多少?+
行和为 2ⁿ,因为每个数都会贡献给下一行的两个数。