In this problem :
How many unique lists of 3 numbers exist, where each number is
1 to 10, inclusive
Median of the list is 5
There is a unique mode in the list
My doubt is : In greg’s solution the pairs (5,1,5), (5,2,5) etc; are included. However, In order to calculate median, we need to arrange the no’s in ascending order. Hence. in the solution (5,1,5), (5,2,5) etc; cannot be included right? Because, if, in this case we arrange them in ascending order, we get 1,5,5, 2,5,5 which are already included in the list.
Hi! thank you for the hint, it means that the possible lists are now 20=10*2. However, still don’t get where to find 8 more cases. I see that it possible 4 lists that then doubled, but still don’t get it. Like, I tried 1,5,1 list, hovewer it would result in median equals 1, right (because to find median we first arrange the list in ascending order)? would you mind helping with this please? Thank you!
What I think is as order does not matter then there is 10 choice for every position but as (5,5,5) is same all the times, that is why we take 1 and deduct other two. So the answer is 28
Sets & Lists differ in two ways: Sets don’t allow for duplicates, but lists allow and In Sets order doesn’t matter but in Lists it does.
Having said that can someone explain me that when we talk of the list
[a,b,c] = [5,1,5] or [5,2,5] how is this a valid list?
Because for the median to be 5 it needs to be arranged in an ascending/descending order such that a<=b<=c or vice versa which is violated in this format!
Are we implying the following:
When we specify a condition like “the median must be 5,” we are not saying that the list is already sorted.
Instead, we are saying that if the list were sorted, the median must be 5.
So,
When counting unique lists, order matters.
[5,1,5][5,1,5][5,1,5] is different from [1,5,5][1,5,5][1,5,5] because lists are ordered structures.
Even though both lists have the same numbers and give the same median when sorted, they are treated as different because their original order is different.
When computing the median of a “list”, you just treat all the entries in the list as a collection of numbers and then do your usual median computation (arrange the numbers such that at least half of the numbers are either less/greater than or equal to the median).
So yes, despite those 3 lists being different by nature, they do indeed have the same median.