English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i have an array of 10000 random integers generated, and i need to find hte median of my data. I know how to sort, but ok bascially, if you would be willing to help, i could email you the code. itll be a .java file, so you can look at it and not have to execute it if you dont want to if you dont trust me or something like that. by the way, there are also several other functiosn in there such as one to find hte mean, max and min numbers of the array. so dont worry about those. i'm not even sure if im sorting right. please help!!!

2007-07-24 19:19:46 · 4 answers · asked by doyoubhangra 1 in Computers & Internet Programming & Design

4 answers

Is this in an accounting program with cells? If so there is a formula for this. If so it will depend a little on the program.. like Excell.

But if say your info is in Cells A1-A1000 your formula would look something like this =sum(a1:a1000)/1000 oh wait. thats the average not the median. Hmmm I will have to think on that some more.

Ok ok. I remember now
The median is the value so that roughly half of the data are smaller and roughly half of the data are larger. There are two formulas for the computation of the median, depending on whether the size of your sample is even or odd. In both cases, sort the data. If n (the number of observations in your sample) is odd, select (n+1)/2 observation. If n is even, select halfway between the n/2 and n/2+1 observation.

You have an even number of integers. This means that you need to find the 500th and the 5001st intigers. For EXAMPLE. if your 500th ingeger was 4.25 and your 501st intiger was 6.77. You add these two intigers (11.02) then devide by two. (5.51)

Good luck

2007-07-24 19:25:14 · answer #1 · answered by blondecougaress 4 · 1 1

If you know what the concept of 'medians' is, which is likely something that was learnt in elementary school, searching for it in a bunch of arrays, frankly, is a piece of cake.

2007-07-25 03:51:46 · answer #2 · answered by Sheqi Nonda 3 · 0 0

This childrens maths link seems to give you the information you are looking for.

2007-07-25 02:39:25 · answer #3 · answered by AnalProgrammer 7 · 1 1

For homework help there are better websites like http://getafreelnacer.com/

2007-07-25 03:04:09 · answer #4 · answered by Anonymous · 0 1

fedest.com, questions and answers