The Yang Hui triangle is a geometric arrangement of the two-item coefficients in a triangle. In Europe, the table is called the Pascal Triangle. Pascal (1623----1662) discovered this rule in 1654, 393 years later than Yang Hui, and 600 years later than Jia Xian.
Brief introduction:
The Yang Hui triangle is a geometric arrangement of the two-item coefficients in a triangle. In Europe, the table is called the Pascal Triangle. Pascal (1623----1662) discovered this rule in 1654, 393 years later than Yang Hui, and 600 years later than Jia Xian. The Yang Hui Triangle is one of the outstanding research achievements in ancient Chinese mathematics, it is a kind of discrete number and shape, it is the graph of the two-item coefficients, and the algebraic properties inherent in the combinatorial number are visualized from the graph.
Result: (The arrangement looks a bit irregular due to two-digit and one-digit reasons)
Java implementations:
PackageA;ImportJava.math.BigInteger;ImportJava.util.*; Public classmain{ Public Static voidMain (string[] args) {System.out.println ("Please enter n"); Scanner Cin=NewScanner (system.in); while(Cin.hasnext ()) {intn=Cin.nextint (); int[] A=New int[N+1] [N+1]; for(inti=0;i<n;i++) { for(intk=0;k<n-i;k++) {System.out.print (" "); } for(intj=0;j<i+1;j++) { if(j==0| | J==n-1) {A[i][j]=1; } Else{A[i][j]=a[i-1][j-1]+a[i-1][j]; } System.out.print (A[i][j]+" "); } System.out.println (); }} cin.close (); }}
Classical algorithm-(c) Pascal Triangle (Yang Hui triangle)