Bug Introduced in 11.3 or earlier
Initial testing indicates this has been addressed in 12.0
Observe:
d1 = UniformDistribution[{0, k}];
d2 = ProbabilityDistribution[1/k, {x, 0, k}];
FullSimplify[PDF[d2, w] == PDF[d1, w], k > w > 0]
FullSimplify[CDF[d2, w] == CDF[d1, w], k > w > 0]
True
True
Mean[OrderDistribution[{#, n}, 1]] & /@ {d1, d2}
SameQ @@ %
{k/(1 + n), k/(1 + n)}
True
All good and correct.
Now (note n in above is explicitly a value here):
Mean[OrderDistribution[{#, 2}, 1]] & /@ {d1, d2}
SameQ @@ %
{k/3, 0}
False
The latter result list for Mean should have the same values.
Bug, or am I missing something obvious?
(11.3 Windows 10)
Update: Motivated by Wolfies' answer (I could not believe MMA did not take into account the domain), observe:
(* FRESH KERNEL START *)
d3 = ProbabilityDistribution[1/k, {x, 0, k}, Assumptions -> k > 0];
(*PDF[OrderDistribution[{d3,2},1],x]*)
Mean[OrderDistribution[{d3, 2}, 1]]
0
Clearly incorrect.
Now:
d3 = ProbabilityDistribution[1/k, {x, 0, k}, Assumptions -> k > 0];
PDF[OrderDistribution[{d3,2},1],x]
Mean[OrderDistribution[{d3, 2}, 1]]
k/3
Correct of course. But the only difference is the use of PDF function between distribution definition and Mean functions. This obviously should have no effect.
The assertion that "The way to resolve all this is to add an assumption on the parameter when defining the original parent pdf" is incorrect: The results above remain with or without the superfluous addition of the assumptions.
You don't even need a clean Kernel - just comment in/out the PDF call and the end result changes
So it seems something even stranger is going on...
d2 = ProbabilityDistribution[1./k, {x, 0, k}]
seems to fix it. Look like a bug, though. $\endgroup$