Pascal's Triangle and Binomial Coefficients
2020-10-09 17:39
This GeoGebra applet dynamically constructs Pascal's Triangle using Sequence and nCr (combinations) commands. It visually demonstrates the geometric arrangement of binomial coefficients, allowing users to observe their symmetry, the recursive addition rule (each number is the sum of the two above it), and combination calculations, serving as an excellent visualization tool for discrete mathematics
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.608.0" app="classic" platform="d" id="3a498192-a1c9-4e2a-9a2b-0c175fcacd10" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="2111" height="927" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.6314542870677404" orientation="1" />
</panes>
<views>
<view id="4097" visible="false" inframe="true" stylebar="true" location="1,1,1,1" size="400" window="1340,205,1159,954" />
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="false" location="1,1" size="300" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="true" location="3,3" size="349" tab="ALGEBRA" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 51 | 551 550 11 , 20 22 21 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 , 538 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502" visible="false" inframe="false" stylebar="true" location="1,1" size="432" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="true" location="3" size="1333" window="100,100,600,400" />
<view id="16" visible="true" inframe="false" stylebar="false" location="1" size="740" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" toolbar="0" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="true" items="0 39 73 62 | 1 501 67 , 5 19 , 72 75 76 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 14 68 | 30 29 54 32 31 33 | 25 17 26 60 52 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />
<input show="true" cmd="true" top="algebra" />
<dockBar show="true" east="true" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="18"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="1333" height="678"/>
<coordSystem xZero="468.49999999999994" yZero="315.0" scale="49.99999999999997" yscale="49.99999999999998"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="11" grid="0"/>
<labelStyle axes="1" serif="true"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<euclidianView>
<viewNumber viewNo="2"/>
<size width="740" height="711"/>
<coordSystem xZero="215.00000000000009" yZero="315.00000000000006" scale="50.00000000000002" yscale="50.000000000000014"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="3"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="1" grid="0"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<algebraView>
<mode val="1"/>
<auxiliary show="true"/>
</algebraView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0" spreadsheet="0"/>
<coordStyle val="0"/>
</kernel>
<tableview min="-2.0" max="2.0" step="1.0"/>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<element type="point" label="A">
<show object="true" label="true" ev="4"/>
<objColor r="255" g="127" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<ggbscript val=""/>
<ggbscript onUpdate=""/>
<coords x="1.25" y="5.14" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="10"/>
</element>
<element type="point" label="B">
<show object="true" label="true" ev="4"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-6.97" y="3.16" z="1.0"/>
<pointSize val="4"/>
<pointStyle val="10"/>
</element>
<element type="point" label="C">
<show object="true" label="true" ev="4"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="-31" y="-1"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-8.07" y="1.96" z="1.0"/>
<pointSize val="4"/>
<pointStyle val="10"/>
</element>
<command name="Vector">
<input a0="B" a1="C"/>
<output a0="u"/>
</command>
<element type="vector" label="u">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-1.1000000000000005" y="-1.2000000000000002" z="0.0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<coordStyle style="cartesian"/>
<startPoint exp="B"/>
</element>
<element type="point" label="D">
<show object="true" label="true" ev="4"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-6.03" y="1.94" z="1.0"/>
<pointSize val="4"/>
<pointStyle val="10"/>
</element>
<command name="Vector">
<input a0="C" a1="D"/>
<output a0="v"/>
</command>
<element type="vector" label="v">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="2.04" y="-0.020000000000000018" z="0.0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<coordStyle style="cartesian"/>
<startPoint exp="C"/>
</element>
<element type="numeric" label="a">
<value val="8.0"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="9"/>
<slider min="0" max="10" absoluteScreenLocation="true" width="200.0" x="30.0" y="50.0" fixed="true" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
<ggbscript onUpdate=""/>
<caption val="层数设置"/>
</element>
<command name="Sequence">
<input a0="Sequence[A + (k * u) + (m * v), m, 0, k]" a1="k" a2="0" a3="a - 1"/>
<output a0="l1"/>
</command>
<element type="list" label="l1">
<show object="false" label="false" ev="4"/>
<objColor r="0" g="100" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Flatten">
<input a0="l1"/>
<output a0="l2"/>
</command>
<element type="list" label="l2">
<show object="false" label="false"/>
<objColor r="0" g="100" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<element type="numeric" label="n">
<value val="36.0"/>
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="9"/>
<slider min="0" max="Length[l2]" absoluteScreenLocation="true" width="200.0" x="30.0" y="90.0" fixed="true" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
<ggbscript onUpdate=""/>
<caption val="显示个数设置"/>
</element>
<command name="Sequence">
<input a0="l2(i)" a1="i" a2="1" a3="n"/>
<output a0="l3"/>
</command>
<element type="list" label="l3">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="100" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<selectionAllowed val="false"/>
<auxiliary val="true"/>
<ggbscript val=""/>
<ggbscript onUpdate=""/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="1"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<command name="nCr">
<input a0="4" a1="2"/>
<output a0="b"/>
</command>
<element type="numeric" label="b">
<value val="6.0"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
</element>
<command name="Sequence">
<input a0="Sequence[nCr[k, m], m, 0, k]" a1="k" a2="0" a3="n - 1"/>
<output a0="l4"/>
</command>
<element type="list" label="l4">
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Flatten">
<input a0="l4"/>
<output a0="l5"/>
</command>
<element type="list" label="l5">
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Sequence">
<input a0="Text["\Large" + (l5(i)), l3(i), true, true]" a1="i" a2="1" a3="n"/>
<output a0="l6"/>
</command>
<element type="list" label="l6">
<show object="true" label="false" ev="4"/>
<objColor r="153" g="51" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<selectionAllowed val="false"/>
<auxiliary val="true"/>
<ggbscript val=""/>
<ggbscript onUpdate=""/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<expression label="text1" exp=""案例:杨辉三角制作\\
1. 准备工作\\
 自由点A,两个控制向量: 纵向v=Vector(B,C), 横向u=Vector(C,D)\\

2. 点阵创建\\
 纵向 k v, k=0...a-1, 横向 m u, m=0...k\\
 \text{l1=Sequence(Sequence(A + k v + m u, m, 0, k), k, 0, a - 1)}\\
 扁平化 l2=Flatten(l1)\\
3. 创建显示控制滑动条 n = Slider(0,length(l2),1)\\
 l3= Sequence(l2(i), i, 1,n)\\

4. 命令nCr(n,r) 创建组合数列\\
 l4= Sequence(Sequence(nCr(k,m),m,0,k),k,0,n-1)\\
 扁平化 l5=Flatten(l4)\\
5. 文本序列创建\\
 l6=Sequence(Text(l5(i), l3(i),true,true),i,1,n)\\
 如果要改变字体大小,可以用 \LaTeX 命令\\
 \text{l6=Sequence(Text(“\Large ”+l5(i), l3(i),true,true),i,1,n)}\\""/>
<element type="text" label="text1">
<show object="true" label="false" ev="43"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<selectionAllowed val="false"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1.0" size="0" style="0"/>
<auxiliary val="true"/>
<startPoint x="-4.12999999999999" y="6.060000000000002" z="1.0"/>
<ggbscript val=""/>
<ggbscript onUpdate=""/>
</element>
<expression label="text2" exp=""显示排列方式设置""/>
<element type="text" label="text2">
<show object="true" label="false" ev="40"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<bgColor r="208" g="240" b="192" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<selectionAllowed val="false"/>
<font serif="false" sizeM="1.4" size="8" style="1"/>
<auxiliary val="true"/>
<startPoint x="-8.810000000000006" y="0.6200000000000004" z="1.0"/>
<ggbscript val=""/>
<ggbscript onUpdate=""/>
</element>
</construction>
</geogebra>