PROJECTS

1. Write brief
codes that will

(a) ask the user for the
coefficients a, b, and c and solve

the quadratic equation ax^2 + bx + c including both roots and allowing for complex values

(b) ask the user for an integer n
and compute the double factorial n!!

(c) ask the user for an integer n
and compute the first n Fibonacci numbers.

(d) ask the user for an integer n
and finds the first n primes

2. Modify
project 1(d) to write the primes to a file.

3. Modify
project 1(d) to write the intervals between primes to a file,

i.e., i_n
= p_n+1 - p_n is the nth interval

4. Generate at least 100 intervals between primes and
compute the average, standard deviation, etc.. How do
these change when you go from 100 to 200to 300 ... to 1000?

5. Generate at
least 100 intervals between primes, and find the distribution of the first
digit, i.e., how often is "1" the first digit, how often is "2",
etc. Does this depend upon how many intervals you choose?

6. What happens to your answers in 5 if you multiply all the
intervals by an arbitrary value (e.g. 7, or 3.1415).
Do you get a very different pattern?

7. Compute the Taylor series of sine, cosine, tangent, etc.,
with n terms (determined by the user) and then compare as a function of x how accurateit is.

8. (For people who have had 410 or 610).
In the harmonic oscillator basis, compute the matrices for x and p.

(a) Compute the commutator [x,p] and see if you get the anwer you expect.

(b) Compute x*x = x^2.
Are the values what you expect?

(c) Compute x^2 * x^2 = x^4. Are the values what you expect?

(d) Using the above, compute the commutator
[x^2, p^2] and compare the result with what you expect analytically.