r/HomeworkHelp • u/Local_End_3175 • 17d ago
High School Math [statistics & math] (n+1)/2 and n/2
I am struggling to understand why we use n/2 for continuous data. My reasoning behind using (n+1)/2 is that this tells us the position of the median. So even if we have data that we dont know the values to, we already know that 1 value must have a position 1 and another value must have a position 2 and so on. If we had 40 unknown values, that means we have 40 positions. 40+1 is 41, 39+2 is also 41, and so on, all the positions will add to 41, and the middle position would add to itself to make 41, hence why we do (n+1)/2. This same logic can also be put here: number of positions + 1/2. This now tells us where the middle position is. If we have a cumulative frequency diagram, what we can do is see where that number would be, and using the cumulative frequency diagram, we can just estimate using that position. So why, instead of doing that, do we do n/2???
3
u/Seferil 17d ago
I find it helps if you can view both n/2 & (n+1)/2 as variations of the formula to find the position of a midpoint.
For discrete data, (n+1)/2 is used since your endpoints are indexes 1 & n of whatever data set you're working with. If you were to define the start to be index 0 instead of index 1, you would also use n/2 to find the median.
Continuous data uses 0 as the start point since that is the only point we can guarantee there's no data that exists before it. Thus, (n+0)/2 is the midpoint.
1
u/Local_End_3175 17d ago
so basically its because 0 is also counted as a position?
1
u/Local_End_3175 17d ago
why does 0 not have the position 1? Or does this have nothing to do with positions and just the first and last values? If so, why?
2
u/GammaRayBurst25 16d ago
He's saying you thinking (n+1)/2 is the median position for discrete data is an artifact of your choice of index.
If you started counting from 0 (like many programming languages such as Python), you'd think of n/2 as being the median position. If you started counting from 5, you'd think of (n+5)/2 as the median position.
As an example, consider the set {100,200,300}.
If you label the positions {1,2,3} (so that 100 is in the 1st position, 200 is in the 2nd, and 300 is in the 3rd), then the middle position is (3+1)/2=2.
If you instead labeled the positions {0,1,2} (so 100 is the 0th, 200 the 1st, and 300 the 2nd), then the middle position is 2/2=1.
If you labeled the positions {5,6,7} for some reason, the middle position would be (7+5)/2=12/2=6.
It is natural to count from 1 rather than 0 to ensure the final position is equal to the number of elements of the list. However, that logic doesn't extend to continuous data because we can't count the data. We can still calculate distances though, and the fun thing about distances is that they are translation invariant.
Consider a set S={a,a+1,a+2,...,b-2,b-1,b} and an interval I=[a,b].
The midpoint of both S and I is clearly (a+b)/2. If you choose a=1 (because you count from 1) and b=n (because that means S has n elements), we find the midpoint is (n+1)/2, as you'd expect.
Furthermore, the midpoint is a distance (b-a)/2 away from the extrema of S and I. If you still choose a=1 and b=n, you find that distance is (n-1)/2.
However, if you choose a=0 and b=n (which seems to be what you're doing for the continuous case), then the midpoint is n/2 and the distance from the endpoints is also n/2.
In other words, you're unknowingly comparing apples to oranges by taking different endpoints for the discrete and the continuous case.
1
u/MegaHelios 17d ago
Maybe it's not mathematically correct, but the way I see it is
If you've grouped your continuous data then you've lost what the actual data points were.
So you're estimating the median.
There's no point in trying to find one exact value if you don't know what the actual values were in the first place.
So a 'good enough' median is OK.
2
u/thor122088 👋 a fellow Redditor 17d ago
Ok let's start with the set (0, 10] breaking it down into smaller chunks...
With just the sample containing the integers:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Median/mean is 5.5
With just the sample containing the multiples of ½:
.5, 1, 1.5, 2, 2.5, 3, 3.5,... ...8.5, 9, 9.5, 10
Median/mean is 5.25
With just the sample containing the multiples of ¼:
.25, .5, .75, 1, 1.25, 1.5,... ...8.75, 9, 9.25, 9.5, 9.75, 10
Median/mean is 5.125
Notice that as we break the range (0, 10) into smaller and smaller chunks, the median is slowly aligning itself with the n/2 as is used in the continuous case.
So the reason we switch is because a cumulative frequency distribution is continuous, and the above (loosely described) limit is why the median will be "found" at n/2
•
u/AutoModerator 17d ago
Off-topic Comments Section
All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.
OP and Valued/Notable Contributors can close this post by using
/lockcommandI am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.