39.1. THE DISTRIBUTION OF nS2/σ2 803

F (x) ≡ P(X ≤ x) . You can obtain your own table of this using MATLAB or you can usethe graph of this function using MATLAB. Here is an easy way to do it. I am sure thereare more elegant ways to obtain this graph but I am picking one which seems to minimizethe fussiness. MATLAB knows how to do numerical integration. The following tells it tointegrate up to n ∗ .05 and place a dot there at the point (n∗ .05,y) where y is the integralup to n∗ .05.

>>hold onr=10;for n=1:1:1200f=@(t)[1/(gamma(r/2)*2ˆ(r/2))*t.ˆ((r/2)-1).*exp(-t/2)];y=integral(f,0,n*.05);plot(n*.05,y,’.’,’Linewidth’,2,’color’,’black’)endThis will produce a nice graph of F (x)≡ P(X ≤ x) , called the probability distribution

function, and so you identify an interval for which the area under the curve is no more than.95. Click on the icon on the tool bar for the graph which says: “data cursor”. This will giveyou a little cross which you can move around and click on points of the graph and it willtell you coordinates, an x coordinate and a y coordinate which is the probability that X ≤ x.This allows you to avoid hunting for things in a table. In fact, MATLAB can essentiallyproduce the tables for you. In ancient times, we had to use tables and we even used tablesof trig. functions and logarithms. There was a whole set of specialized techniques whichare now obsolete which we suffered with long ago. Now of course, there is software whichcan do all of it for you so it is important to understand what the software is doing.

If you have scientific notebook, it is even easier. In this case, all you have to do is typein math mode ∫ x

0

1Γ(10/2)210/2 t4e−t/2dt

and ask it to graph this function of x. It will do so. Then you click on the icon which letsyou identify coordinates just like you can do in MATLAB. The quality of the graph is notas good as what you get in MATLAB, but it does the job quite well with less hassle. I likelooking at pictures better than rummaging through tables. However, if you like to look attables, try this. Matlab will make a table for you.

>> hold onT=[]; r=10;for n=1:1:100f=@(t)[(gamma(r/2)*2ˆ(r/2))ˆ(-1)*t.ˆ((r/2)-1).*exp(-t/2)];x=n*.5;y=integral(f,0,x);T=[T; x y];endTI found this on line which is where I usually go for questions about MATLAB. It will

produce a table having two columns, one for x and the next for y which will be the proba-bility up to x.

Here are two points on the graph: (3.45, .0312) and (21.85, .9841) . Thus the probabilitythat X ≤ 21.85 is .9841 and the probability that X ≤ 3.45 is .0312. It follows that theprobability that X ∈ [3.45,21.85] is .9841− .0312 = 0.9529. Therefore, the probability