1 / 6

Триъгълник на Паскал

Триъгълник на Паскал. 1. Биномни коефициенти. Примери: Теорема за биномните коефициенти:. 2. Триъгълник на Паскал. 3. Начини за изчисляване на биномните коефициенти. C(n,k)=C(n-1,k-1)+C(n-1,k). 4. Вариация 1 (двумерна таблица). Program dtv1; Const n=9;

Download Presentation

Триъгълник на Паскал

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Триъгълник на Паскал

  2. 1. Биномни коефициенти • Примери: • Теорема за биномните коефициенти:

  3. 2. Триъгълник на Паскал

  4. 3. Начини за изчисляване на биномните коефициенти • C(n,k)=C(n-1,k-1)+C(n-1,k)

  5. 4. Вариация 1 (двумерна таблица) Program dtv1; Const n=9; Type pastr=array[0..n,o..n] of integer; Var pt:pastr; i,j:integer; Begin For i:=0 to n do begin pt[i,0]:=1; pt[i,i]:=1; write(pt[i,0]:4); for j:=1 to i-1 do begin pt[i,j]:=pt[i-1,j-1]+pt[i-1,j]; write(pt[i,j]:4); end; writeln(pt[i,i]:4); end End.

  6. 5. Вариация 2 (едномерна таблица) Program etv2; Const n=9; nr=(n+1)*(n+2) div 2; Type pastr=array[0..nr] of integer; Var pt:pastr; i,j:integer; Function index(i,j:integer): integer; Begin index:=i*(i+1) div 2 + (j+1) end; Begin for i:=0 to n do begin pt[index(i,0)]:=1; pt[index(i,i)]:=1; write(pt[index(i,0)]:4); for j:=1 to i-1 do begin pt[index(i,j)]:=pt[index(i-1,j-1)]+pt[index(i-1,j)]; write(pt[index(i,j)]:4); end; writeln(pt[index(i,j)]:4); end End.

More Related