Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A Galton board is a device invented by English scientist Sir Francis Galton which illustrates the convergence of a binomial distribution towards a normal distribution.
A Galton board is a device invented by English scientist Sir Francis Galton which illustrates the convergence of a binomial distribution towards a normal distribution. Nails are driven into the upper part of the board, so that a marble dropped on the board passes either to the right or to the left for each row of nails with a probability 12. In the lower part the balls are gathered in columns, according to the number of passages to the left and passage to the right that they made as shown in fig. 1.
Thus each box corresponds to a possible outcome of a binomial experiment (as than a repeated Bernoulli experiment) and one can notice that the distribution of the balls in the squares approximate the shape of a Gaussian curve, in other words: the binomial law converges to the normal law. It is therefore an illustration of the De Moivre-Laplace theorem (case particular of the central limit theorem). In this exercise, we are asked to write a program that displays a Galton board at 4 columns on a JPanel contained in a JFrame. The board should be centered horizontally in the JPanel (see Figure 2 (a) and (b) following) and resizable proportionally with the JPanel. Every time you resize the JPanel, the red ball is redeployed randomly in one of the four columns.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started