This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to

Problem #991

Một phiên bản khác của tam giác Pascal

Added by phuongnam 5 months ago.

Status: New Start Date: 04-11-2012
Priority: Normal Due date:
Assigned to: - % Done:


Category: -
Target version: -
Votes: 0/0


Có lần tôi đã giới thiệu tam giác Pascal có dạng một tam giác cân. Ở đoạn mã này, là tam giác vuông cân.

% Store values
\c@pgf@counta=#1% n
\c@pgf@countb=#2% k

% Take advantage of symmetry if k > n - k

\advance\c@pgf@countc by-\c@pgf@countb%

% Recursively compute the coefficients
will hold the result
\c@pgf@countd=0% counter
\pgfmathloop% c -> c*(n-i)/(i+1) for i=0,...,k-1
\ifnum\c@pgf@countd \multiply\c@pgf@countc by\c@pgf@counta%
\advance\c@pgf@counta by-1%
\advance\c@pgf@countd by1%
\divide\c@pgf@countc by\c@pgf@countd%

\foreach \n in {0,...,15} {
\foreach \k in {0,...,\n} {
\node at (\k,-\n) {$\binomialCoefficient{\n}{\k}$};