Tag Info

New answers tagged

3

The distribution of the means of sufficiently large sets of random drawings from a given distribution (well, many of them) approaches a normal distribution with a mean equal to the mean of the given distribution and a standard deviation equal to the standard deviation of the given distribution divided by the square root of the sample size -1. Using this ...


3

Yes, there is! One way to do such things more quickly: multinomialRangedIP[n_, ps_, min_, max_] := Total[PDF[MultinomialDistribution[n, ps], Permutations@#] & /@ IntegerPartitions[n, {Length@ps}, Range[min, max]], 2] Using the OP example, multinomialRangedIP[50, N@{1/2, 3/8, 1/16, 1/16}, 5, 20] is over 200X faster. That advantage grows as ...


6

In version 10.0.2 Mathematica is using an incorrect standardization rule Statistics`Library`StandardizationRules[{x, y}, MultinormalDistribution[{0, 0}, {{2, 0.5}, {0.5, 1}}]] {{x -> x/Sqrt[2], y -> y}, MultinormalDistribution[{0, 0}, {{1, 0.353553}, {0.353553, 1}}]} This is incorrect as Expectation[(x y)/Sqrt[2], {x, ...


2

f[u_] := And[#1 > #2, #1 > #3] & @@ (Plus @@@ Partition[Mod[u, 13, 1], 2]) fun[n_] := With[{r = Table[RandomSample[Range[52], 6], {n}]}, N[Length@Pick[r, f /@ r, True]/n]] Not particularly efficient but: fun[10000000] yielded: 0.308507


8

Don't even know how I came across this old question, but, interesting and seeing as Mr. W asked it, it piqued my interest. The answer by David is a good use of simulation, and his "back-o-the-envelope" approximation using the probability functions of Mathematica over a discrete uniform is also kind of neat. The other two answers, however are flat-out ...



Top 50 recent answers are included