📚 3 Paths parallel to the axes | 平行于坐标轴的三维路径
When we move through a three‑dimensional grid with steps only parallel to the x‑, y‑ and z‑axes, each step is one of exactly three types: a positive unit step in the x‑direction, a positive unit step in the y‑direction, or a positive unit step in the z‑direction. This seemingly simple restriction creates a rich family of combinatorial counting problems that appear frequently in IB Mathematics: from counting the number of ways to reach a certain lattice point to solving probability questions with multinomial coefficients. In this article we explore the mathematics of 3‑D axis‑parallel paths, covering the fundamental formulas, recursive relationships, applications with obstacles, and links to Pascal‑like structures in higher dimensions.
当我们在三维网格中移动,且每一步只能平行于 x 轴、y 轴或 z 轴时,每一步恰好是三种类型之一:沿 x 方向的一个正单位步、沿 y 方向的一个正单位步,或沿 z 方向的一个正单位步。这个看似简单的限制产生了一类丰富的组合计数问题,这些题目频繁出现在 IB 数学中:从计算到达某个格点的路径数,到使用多项式系数解决概率问题。在本文中,我们将探讨三维轴平行路径的数学,涵盖基本公式、递推关系、带有障碍物的应用,以及与高维帕斯卡结构之间的联系。
1. Moving in a 3D lattice | 在三维格点中移动
Imagine a grid of points with integer coordinates (x, y, z). Starting from the origin (0,0,0), we wish to travel to the point (a, b, c) where a, b, c are non‑negative integers. A move is only allowed to increase exactly one coordinate by 1, and that move must be parallel to one of the three axes. Therefore, a sequence of steps can be represented as a string of letters: X for a step in the x‑direction, Y for a step in the y‑direction, and Z for a step in the z‑direction. To reach (a, b, c) we need exactly a X‑steps, b Y‑steps and c Z‑steps, making a total of a+b+c moves.
想象一个由整数坐标 (x, y, z) 组成的点阵。从原点 (0,0,0) 出发,我们希望到达目标点 (a, b, c),其中 a, b, c 是非负整数。每次移动只允许将恰好一个坐标增加 1,并且该移动必须平行于三个坐标轴之一。因此,一个步骤序列可以表示为一个字母串:X 表示沿 x 方向的步,Y 表示沿 y 方向的步,Z 表示沿 z 方向的步。要到达 (a, b, c),我们需要恰好 a 个 X 步、b 个 Y 步和 c 个 Z 步,总共 a+b+c 步。
2. The fundamental counting formula | 基本计数公式
Since all moves are independent magnitudes, the problem reduces to arranging a sequence of a X’s, b Y’s and c Z’s. The number of distinct sequences is given by the multinomial coefficient: number of paths = (a+b+c)! / (a! b! c!). This can also be written as C(a+b+c; a, b, c) or understood as choosing the positions for the X‑steps, then for the Y‑steps, with the Z‑steps filling the remaining positions. For the special case where one of the coordinates is zero, we recover the two‑dimensional result: C(a+b, a) = (a+b)!/(a! b!).
由于所有移动是独立进行的,问题转化为排列由 a 个 X、b 个 Y 和 c 个 Z 组成的序列。不同序列的数目由多项式系数给出:路径数 = (a+b+c)! / (a! b! c!)。该值也可记作 C(a+b+c; a, b, c),或者理解为先为 X 步选择位置,再为 Y 步选择位置,剩下的位置由 Z 步填入。当一个坐标为零时,我们回到二维情况:C(a+b, a) = (a+b)!/(a! b!)。
3. Worked example – 2×2×2 cube | 例题 – 2×2×2 立方体
Let us count the number of shortest paths from (0,0,0) to (2,2,2) using only positive axis‑parallel steps. We require 2 X‑steps, 2 Y‑steps and 2 Z‑steps, giving a total of 6 steps. The number of paths is 6!/(2! 2! 2!) = 720/(2×2×2) = 720/8 = 90. Thus there are 90 distinct ways to move through the 2×2×2 grid from one corner to the opposite corner without any backtracking.
我们来计算从 (0,0,0) 到 (2,2,2) 且只使用正向轴平行步的最短路径数。我们需要 2 个 X 步、2 个 Y 步和 2 个 Z 步,总计 6 步。路径数为 6!/(2! 2! 2!) = 720/(2×2×2) = 720/8 = 90。因此,在不允许回退的情况下,从 2×2×2 立方体的一个角移到对角有 90 条不同路径。
4. Link to trinomial expansion | 与三项式展开的联系
The multinomial coefficient appears naturally in the expansion of (x + y + z)ⁿ. For n = a+b+c the coefficient of xᵃ yᵇ zᶜ is exactly (a+b+c)!/(a! b! c!). In the context of axis‑parallel paths, each step corresponds to multiplying by one of the three variables. This interpretation is powerful: the sum of all path counts for a fixed total number of steps n is 3ⁿ, which matches the sum of all multinomial coefficients for a given n. Thus, 3‑D path problems and trinomial expansions are two sides of the same combinatorial coin.
多项式系数自然地出现在 (x + y + z)ⁿ 的展开式中。当 n = a+b+c 时,xᵃ yᵇ zᶜ 的系数恰好是 (a+b+c)!/(a! b! c!)。在轴平行路径的语境下,每一步相当于乘以这三个变量之一。这种解释非常有力:对于固定的总步数 n,所有路径数的总和为 3ⁿ,这与给定 n 下所有多项式系数的总和相匹配。因此,三维路径问题与三项式展开是同一组合硬币的两面。
5. Recursive relation and Pascal’s tetrahedron | 递推关系与帕斯卡四面体
Just as 2‑D axis‑parallel paths generate Pascal’s triangle, the 3‑D version generates Pascal’s tetrahedron. Let f(a,b,c) denote the number of paths from (0,0,0) to (a,b,c). Then f(a,b,c) satisfies the recurrence f(a,b,c) = f(a−1,b,c) + f(a,b−1,c) + f(a,b,c−1) for a,b,c ≥ 1, with base conditions f(a,0,0) = f(0,b,0) = f(0,0,c) = 1. This recurrence builds the tetrahedron layer by layer. For small values the pattern can be visualised in a table whose entries are cross‑sections of the tetrahedron.
正如二维轴平行路径生成帕斯卡三角形,三维版本生成帕斯卡四面体。设 f(a,b,c) 表示从 (0,0,0) 到 (a,b,c) 的路径数。那么 f(a,b,c) 满足递推关系:对 a,b,c ≥ 1,f(a,b,c) = f(a−1,b,c) + f(a,b−1,c) + f(a,b,c−1),基础条件为 f(a,0,0) = f(0,b,0) = f(0,0,c) = 1。这个递推关系逐层构建四面体。对于较小的值,可以通过表格展示四面体的横截面。
| (a,b,c) | Paths f(a,b,c) |
|---|---|
| (0,0,0) | 1 |
| (1,0,0), (0,1,0), (0,0,1) | 1 |
| (1,1,0), (1,0,1), (0,1,1) | 2 |
| (1,1,1) | 6 (since 3!/(1!1!1!) = 6) |
| (2,1,0) | 3!/(2!1!0!)=3 |
The tetrahedron can be built by repeatedly adding the three ‘parent’ cells: each interior number is the sum of the three numbers that sit one step back along each axis.
四面体可以通过不断加和三个“父”单元来构建:每一个内部数字是分别沿三个轴后退一步的那个数字之和。
6. Paths with obstacles – avoiding forbidden points | 带障碍物的路径 – 避开禁止点
Obstacle problems are common in IB examination questions. Suppose we want the number of paths from (0,0,0) to (a,b,c) that avoid a particular forbidden lattice point P = (p,q,r). The number of valid paths is the total number of unrestricted paths minus the number of paths that pass through P. Since any path that goes through P splits into two independent sub‑paths – from the start to P, and from P to the destination – the number of paths passing through P is the product f(p,q,r) × f(a−p, b−q, c−r). Thus the number of good paths is f(a,b,c) − f(p,q,r) × f(a−p, b−q, c−r).
障碍物问题在 IB 试题中很常见。假设我们希望计算从 (0,0,0) 到 (a,b,c) 且避开某个特定禁止格点 P = (p,q,r) 的路径数。有效路径数等于未受限路径总数减去经过 P 的路径数。由于任何经过 P 的路径可以分成两段独立的子路径——从起点到 P,再从 P 到终点——经过 P 的路径数为乘积 f(p,q,r) × f(a−p, b−q, c−r)。因此,好路径数为 f(a,b,c) − f(p,q,r) × f(a−p, b−q, c−r)。
If multiple obstacles must be avoided, inclusion–exclusion principles can be applied. For two forbidden points P and Q, we subtract paths through P and through Q, then add back paths that go through both (if both lie on a common axis‑parallel route). The method extends smoothly from two dimensions to three.
如果要避开多个障碍物,可使用容斥原理。对于两个禁止点 P 和 Q,我们先减去经过 P 和经过 Q 的路径,然后加回同时经过两者的路径(如果两者存在共线的轴平行路径)。该方法从二维平滑地推广到三维。
7. Applying the reflection trick in 3D | 三维中的反射技巧
In two dimensions the reflection principle is used to count paths that touch or cross a line, but in 3‑D we often apply it to paths restricted by a plane or a half‑space. For example, to count paths from (0,0,0) to (a,b,c) that never have x > y, we can map any “bad” path (one that steps into the forbidden region) to a symmetric path that starts after reflecting the first segment across the plane x = y. The technique reduces the count to a difference of two unrestricted multinomial coefficients. While conceptually analogous to the 2‑D ballot problem, the algebraic expressions become larger, yet the underlying reasoning remains identical.
在二维中,反射原理用于计算触碰或跨越某条线的路径数,而在三维中我们常常将其应用于受平面或半空间限制的路径。例如,要计算从 (0,0,0) 到 (a,b,c) 且从不出现 x > y 的路径数,我们可以将任何“坏”路径(踏入禁区者)映射为一条对称路径,该对称路径通过将首次穿越平面 x=y 之前的部分反射得到。这种技巧将计数归结为两个无限制多项式系数之差。虽然概念上与二维的选票问题类似,代数表达式会变大,但背后的推理完全相同。
8. Connection with probability and random walks | 与概率和随机游走的联系
If at each step we choose one of the three positive directions with equal probability 1/3, the probability of following a particular path of length n is (1/3)ⁿ. The probability of arriving at (a,b,c) after n = a+b+c steps is the number of paths multiplied by (1/3)ⁿ, i.e. (a+b+c)!/(a! b! c!) × (1/3)ᵃ⁺ᵇ⁺ᶜ. This forms a discrete probability distribution known as the trinomial distribution, which generalises the binomial distribution. It appears in modelling phenomena where an outcome has three possible non‑negative increments, such as particle diffusion on a cubic lattice.
如果在每一步中我们以相等的概率 1/3 选择三个正方向之一,那么沿着某条长度为 n 的特定路径的概率为 (1/3)ⁿ。在 n = a+b+c 步后到达 (a,b,c) 的概率为路径数乘以 (1/3)ⁿ,即 (a+b+c)!/(a! b! c!) × (1/3)ᵃ⁺ᵇ⁺ᶜ。这就形成了一个离散概率分布,称为三项分布,它是二项分布的推广。它出现在对某种具有三种可能非负增量的结果建模时,如粒子在立方格点上的扩散。
9. Extension to higher dimensions | 向更高维推广
The reasoning generalises seamlessly to d‑dimensional grids. From the origin to (a₁, a₂, …, a_d) using only positive unit steps parallel to the axes, the number of paths is the multinomial coefficient (a₁+a₂+…+a_d)!/(a₁! a₂! … a_d!). The recurrence involves summing d neighbours, and the combinatorial object is a d‑dimensional simplex of Pascal type. For IB students, the key take‑away is that the multinomial coefficient is the natural extension of the binomial coefficient, and problems with three axes simply require handling combinations of three letters.
这种推理可以无缝地推广到 d 维网格。从原点到 (a₁, a₂, …, a_d),只使用平行于轴的正向单位步,路径数为多项式系数 (a₁+a₂+…+a_d)!/(a₁! a₂! … a_d!)。递推关系涉及对 d 个相邻格子求和,而组合对象是一个 d 维帕斯卡型单形。对于 IB 学生来说,关键收获在于多项式系数是二项式系数的自然推广,而涉及三个坐标轴的问题只需要处理三个字母的组合排列。
10. IB‑style question walkthrough | IB 风格题目详解
Question: In a 3D grid, a bee starts at (0,0,0) and can only fly one unit per step in the positive x, y or z direction. Find the number of ways the bee can reach (3,2,2) without ever visiting the point (1,1,1).
问题:在一个三维网格中,一只蜜蜂从 (0,0,0) 开始,每一步只能沿正 x、正 y 或正 z 方向飞行一个单位。求蜜蜂到达 (3,2,2) 且从未经过点 (1,1,1) 的飞行路径数。
Solution: Total paths to (3,2,2) = (3+2+2)!/(3!2!2!) = 7!/(6×2×2) = 5040/24 = 210. Paths through (1,1,1) = [paths to (1,1,1)] × [paths from (1,1,1) to (3,2,2)]. To (1,1,1): 3!/(1!1!1!) = 6. From (1,1,1) to (3,2,2) the required increments are (2,1,1), so paths = (2+1+1)!/(2!1!1!) = 4!/2 = 12. Product = 6×12 = 72. Good paths = 210 − 72 = 138.
解答:到达 (3,2,2) 的总路径数 = (3+2+2)!/(3!2!2!) = 7!/(6×2×2) = 5040/24 = 210。经过 (1,1,1) 的路径数 = [到 (1,1,1) 的路径] × [从 (1,1,1) 到 (3,2,2) 的路径]。到 (1,1,1):3!/(1!1!1!) = 6。从 (1,1,1) 到 (3,2,2) 所需的增量是 (2,1,1),所以路径数 = (2+1+1)!/(2!1!1!) = 4!/2 = 12。乘积 = 6×12 = 72。有效路径数 = 210 − 72 = 138。
This classic two‑point avoidance question highlights the multiplication principle and the importance of correctly applying the multinomial coefficient. IB examiners often combine such counting with probability: for instance, if the bee chooses each direction with probability 1/3, what is the probability of arriving at (3,2,2) without touching (1,1,1)? Simply divide the number of good paths by the total number of possible step sequences (3⁷), but careful: the total number of sequences of length 7 is 3⁷, yet not all sequences of length 7 reach (3,2,2). The correct probability must use only the paths that actually end at the target, and each path has probability (1/3)⁷. Therefore the desired probability = 138 × (1/3)⁷.
这一经典的两点避让问题凸显了乘法原理和正确应用多项式系数的重要性。IB 考官常将这种计数与概率结合:例如,如果蜜蜂以概率 1/3 随机选择方向,求在不经过 (1,1,1) 的前提下到达 (3,2,2) 的概率。只需用好路径数除以符合条件的总共可能步数序列?注意:总长度为 7 的序列数为 3⁷,但并非所有长度为 7 的序列都能到达 (3,2,2)。正确的概率必须只考虑实际到达目标的路径,且每条路径的概率为 (1/3)⁷。因此所求概率 = 138 × (1/3)⁷。
11. Common pitfalls and misconceptions | 常见误区与概念澄清
Many students confuse the total number of unrestricted sequences of length n (which is 3ⁿ) with the number of paths that reach a specific point. Only sequences with exactly the right counts of X, Y and Z reach the target. Another frequent mistake is treating the three axes as independent choices without accounting for the ordering – the order of steps matters because each sequence of axis choices is a distinct path. Finally, when using the formula (a+b+c)!/(a! b! c!), forgetting that 0! = 1 can lead to arithmetic errors in boundary cases where one coordinate is zero.
许多学生将长度为 n 的无限制序列总数(即 3ⁿ)与到达特定点的路径数混淆。只有恰好具有正确数量的 X、Y、Z 步的序列才能到达目标。另一个常见错误是将三个轴的选择视为独立而不考虑顺序——步骤的顺序很重要,因为每个轴选择序列都是一条不同的路径。最后,在使用公式 (a+b+c)!/(a! b! c!) 时,忘记 0! = 1 会导致坐标为零的边界情况出现算术错误。
12. Summary and key takeaways | 总结与核心收获
Three‑dimensional axis‑parallel paths form a natural progression from the 2‑D grid walks already familiar in binomial counting. The core formula is the multinomial coefficient (a+b+c)!/(a! b! c!), which counts the number of distinct sequences of three types of steps. By establishing the recurrence f(a,b,c) = f(a−1,b,c) + f(a,b−1,c) + f(a,b,c−1), students can solve problems dynamically and appreciate the structure of Pascal’s tetrahedron. Obstacle problems, reflection methods, and probability calculations build directly on these foundations. Mastering the 3‑D case not only secures marks in IB combinatorics questions but also prepares learners for higher‑dimensional thinking in statistics and computer science.
三维轴平行路径是从二项式计数中已熟悉的二维网格游走的自然延伸。核心公式是多项式系数 (a+b+c)!/(a! b! c!),它对三种类型步骤的不同序列进行计数。通过建立递推关系 f(a,b,c) = f(a−1,b,c) + f(a,b−1,c) + f(a,b,c−1),学生可以动态地解决问题并领会帕斯卡四面体的结构。障碍物问题、反射方法和概率计算直接建立在这些基础之上。掌握三维情形不仅能确保在 IB 组合问题中得分,还能为学习者在统计学和计算机科学中的高维思维做好准备。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply