/* 1 1 1 1 2 1 1 3 3 1 n=3; k=3; n*(n-1)*(n-2) ------------------ 1*2*3 */ import java.util.Arrays; class ProbabilityTable { public static void main(String[] args) { int max = 10; int[][] arr = new int[max][]; for(int i=0;i<arr.length;i++){ arr[i] = new int[i+1]; } for(int i=0;i<arr.length;i++){ for(int j=0;j<arr[i].length;j++){ int num = 1; for(int m=1;m<=j;m++){ num = num*(i-m+1)/m; } arr[i][j] = num; } } for(int i=0;i<arr.length;i++) System.out.println(Arrays.toString(arr[i])); } }