standard deviation and mode
<p>I have a  system that monitors the performance of students.  It tabulates the number of students who gained a score of 1,1.25,1.5,....5 (this is our grading system).  For example:</p>

<pre><code>grading system     number of students
1                  12
1.25               10
1.5                15
1.75               15
2                  20
2.25               1
2.5                5
2.75               6
3                  8
5                  0
</code></pre>

<p>From this example, I need my system to determine which is the mode and then print it.  I also need to get the standard deviation.</p>

<p>I need this in PHP.  Can anyone help me with this?
Your ideas, comments, and suggestions are appreciated.</p>

<h3>Update:</h3>

<p>Here's what I've done so far:</p>

<p>Finished the standard deviation...but there are still discrepancies i can't resolve...when i calculate the standard deviation manually..the answer is different from the output of my system.. >.&lt;</p>

<p>While for the mode I used an array..this is my code:</p>

<pre><code>$sample = array($one[$ctr],$two[$ctr],$three[$ctr],$four[$ctr],$five[$ctr],$six[$ctr],$seven[$ctr],$eight[$ctr],$nine[$ctr],$ten[$ctr],$fda[$ctr]);

         rsort($sample);
         $holder = $sample[0];
     //$holder = $mode;
</code></pre>

<p>The sorting is successful and I can the highest number but I need to print the value of <code>$holder</code> to a table using fpdf.</p>

<p>Any ideas, why the value is not visible in the output?</p>
