Let's define the wavefunction:
> psi := (n,x) -> sqrt(2/L)*sin(n*Pi*x/L);
For n=1:
> evalf(int(psi(1,x)^2,x=0..L/10));
For n=2:
> evalf(int(psi(2,x)^2,x=0..L/10));
For n=3:
> evalf(int(psi(3,x)^2,x=0..L/10));
Define a function whose value is the probability as a function of n:
> pr_left_tenth := n -> int(psi(n,x)^2,x=0..L/10);
Let's test it:
> evalf(pr_left_tenth(1));
To plot this function, use the plotting trick given in the handout:
> plot(pr_left_tenth,0..100,style=POINT,adaptive=false, > sample=[seq(i,i=1..100)]);
The probability approaches . As n gets larger, there
are more and more peaks in the probability density and these peaks are
more and more tightly spaced. Accordingly, every interval becomes more
or less the same and the probability becomes uniform in the box. This
agrees with the correspondence principle.