// quincunx simulation import java.awt.*; import javax.swing.*; public class NormalQuincunx { public static void main (String[] args) { int bins; int balls; double biasSD, binSize; String input; input = JOptionPane.showInputDialog("Number of bins","31"); bins = Integer.parseInt(input); input = JOptionPane.showInputDialog("Number of balls","1000"); balls = Integer.parseInt(input); input = JOptionPane.showInputDialog("0 < Bias to middle < 1", "0.5"); biasSD = Double.parseDouble(input); // how to get this to change the standard deviation???? int[] B = new int[bins]; for (int ball=0; ball= .5) { //row 0: top peg falls to right pluses++; } for (int row=1; rowodd number of pegs And at center peg if (Math.random() >= .5) pluses++; //fall to right } else if (pluses <= row/2) { //in left half if (Math.random() < biasSD) //falls toward center pluses++; } else //in right half if (Math.random() > biasSD) //falls away from center pluses++; B[pluses]++; //lands in this bin } System.out.println("Frequency histogram"); for (int bin=0; bin