This is a 200 point Exam.  When you are done, email your notebook to: 
 	bsnyder@lssu.edu
AND
	elschemm@furball.schemm.lssu.edu
Good Luck!

Differential Calculus Area Problem
(20 pts)

A closed rectangular box costs $A per square foot for the top and bottom and $B per square foot for the sides .   If the volume V is fixed,  
    what should the dimensions be to minimize the cost?  How does your answer change is the box is open?

Integral Calculus Area Problem
(20 pts)

Consider the graph of the function y=sin(x) for 0≤x≤π.
          	Find a horizontal line y=k that divides the area under this arch of the curve into two equal pieces.

A different absolute value
(20 pts)

\(Fix\ a\ prime\ number\ p . \ \ The\ p - 
      adic\ absolute\ value\ of\ an\ integer\ m\ is\ defined\ to\ be\ \((1\/p)\)\^n, \ 
    where\ m = \(p\^n\) 
        q\ is\ the\ factorization\ of\ m . \ \ For\ example, \ 
    with\ respect\ to\ the\ prime\ 2, \ 
    the\ 2 - adic\ absolute\ value\ of\ 4\ is\ 1\/4, \ 
the\ 2 - adic\ absolute\ value\ of\ 6\ is\ \(1\/2\) and\ the\ 2 - 
      adic\ absolute\ value\ of\ 5\ is\ 1. \ \ You\ must\ create\ a\ function\ that\ has\ as\ input\ a\ pair\ of\ integers\ m\ and\ p\ whose\ output\ is\ the\ p - adic\ absolute\ value\ of\ \(\(m\)\(.\)\)\)

Games of chance
(20 pts)

\(The\ following\ method\ is\ a\ probabilistic\ method\ for\ determining\ the\ value\ of\ π . \ \ Select\ a\ number\ of\ points\ at\ random\ in\ the\ unit\ square\ {\((x, y)\), 0 ≤ x ≤ 1, 
              0 ≤ y ≤ 
                1} . \ \ Count\ the\ number\ of\ points\ which\ lie\ inside\ the\ unit\ circle\ x\^2 + y\^2 = 
      1. \ The\ ratio\ of\ these\ two\ numbers\ is\ going\ to\ be\ a\ rational\ multiple\ of\ π . \ \ Develop\ the\ code\ to\ create\ this\ simulation, \ 
    run\ 5000\ cycles\ and\ give\ your\ approximation\ to\ π\ given\ by\ this\ \(\(simulation\)\(.\)\)\)

The sky is falling
(20 pts)

\(Newton' 
        s\ Law\ of\ Universal\ Gravitation\ \(states : \ 
          Every\ point\ mass\ attracts\ every\ other\ point\ mass\ by\ a\ force\ directed\ along\ the\ line\ connecting\ the\ two . 
              This\ force\ is\ proportional\ to\ the\ product\ of\ the\ masses\ and\ inversely\ proportional\ to\ the\ square\ of\ the\ distance\ between\ \(them : F\)\) = G \(\( m\_1\) m\_2\)\/r\^2\)

Use the Graphics`PlotField3D`to illustrate this idea using a point mass at the origin representing the Earth

Fig[ure] Newtons [method of computing Pi]
(70 pts)

Sir Issac Newton also came up with a formula for computing Pi.  It's a little uglier than the last one, but it converges much quicker.  Here it is (with four terms):

(π/6) =  
      (1/2) + (1/2)[(1/(3*(2^3)))] + ((1 * 3)/(2 * 4))[
            (1/(5*(2^5)))] + ((1*3*5)/(2*4*6))[
            (1/(7*(2^7)))]  ...

Like last time, your job is simple:
    Write a function NPi[t,n] which computes Pi with t terms using Newtons formula.  Your answer should contain n digits after the decimal point.  So, for instance:
    NPi[200, 8] should give me 3.14159265

NPi :=

Verify your function works by showing that the first 20 digits of Pi match the system constant of Pi.

How many terms do you need to get 30 digits of accuracy?

Question your Sanity
(30 pts)

Answer the following questions completely and correctly:
1) We said that Mathematica has infinite precision.  How is this different from programs written in C, C++, Pascal, etc.  Why does Mathematica have infinite precision and other languages do not? [what is different about the way they store numbers]

2) If Mathematica has infinite precision, and regular programming languages do not, why isn't everything written in Mathematica? [ie. what are the downsides, or cost of that infinite precision]

3) Suppose that I want to use C or C++, but I need to have much more precision than the 5-10 digits usually provided with C and C++.  What can I do to have the bulk of my program in nice, comfy C/C++ but still get the precision that I need.