Inconsistency in Histogram's "Probability" Binsize

Context

Let me define a Probability distribution (following the documentation and with some connection to this question)

DD = ProbabilityDistribution[(Sqrt/\[Pi]) (1/(1 + x^4)), {x, -\[Infinity], \[Infinity]}];

which is normalized properly CDF[DD,1000]//N (* 1 *), and looks like this

Plot[Evaluate[PDF[DD, x]], {x, -4, 4}, Filling -> Axis] I am interested in drawing samples from this distribution

If I let Mathematica do his job:

Show[RandomVariate[DD, 1500] // Histogram[#, Automatic, "Probability"] &,
Plot[PDF[DD, x], {x, -5, 5}, PlotStyle -> Directive[Red, Thick]]]

I get this which strongly suggests it got the normalisation wrong.

Question

Is this a known bug or a misunderstanding on how Histogram works on my part?

Attempt

Now let me evaluate by hand its normalized histogram

hh = RandomVariate[DD, 15000]//BinCounts[#, {-5, 5, 1/4}] &;
h = 4 hh/Total[hh];
h = Transpose[{Table[i - 1/4, {i, -5 + 1/4, 5, 1/4}], h}];

I get this

Show[ListLinePlot[h, InterpolationOrder -> 0, PlotRange -> All, Filling -> Axis],
Plot[PDF[DD, x], {x, -5, 5}, PlotStyle -> Directive[Red, Thick]]] Turning back to the Mathematica Automated procedure, if I force the binsize and the corresponding Normalization, I get this

Show[RandomVariate[DD, 150000]//Histogram[#, {-5, 5, 1/4}, "Probability"] &,
Plot[PDF[DD, x]/4, {x, -5, 5}, PlotStyle -> Directive[Red, Thick]]] But note the 1/4 factor in the PDF (corresponding to the binsize).

• If you use "PDF" instead of "Probability", then the scaling comes out right... Nov 2 '12 at 9:53
• @J.M. so it was a trap! You knew the answer: how wicked! Well you can write it as a one-liner now :-) Nov 2 '12 at 9:56
• Well, you got a dandy answer from jVincent, so it still turned out pretty darn good, eh? :) Nov 2 '12 at 10:01
• @J.M. are you guys working as a team? Nov 2 '12 at 10:02
• FWIW: HistogramDistribution[] would have been a slightly tidier way to do your attempt. Nov 2 '12 at 11:02 