# Question:Statistics fails to reject invalid parameter values

## Question:Statistics fails to reject invalid parameter values

Maple 2015

Maple doesn't completely check the condition on the number of trials "n" for Binomial and NegativeBinomial distributions (package Statistics).
The attribute "Conditions" explicitely says that n must be a strictly positive integer but no strictly positive real valuereturna an error (ok, it would be stupid to set n to a non integer value !!!).

I think it is a default that ought to be corrected in future releases (this default still exists in Maple 2018)

 > restart
 > kernelopts(version)
 (1)
 > with(Statistics):

BINOMIAL DISTRIBUTION

 > X := RandomVariable(Binomial(n, p)): L := [attributes(X)][3]: A := exports(L)
 (2)
 > L:-Conditions
 (3)
 > # Maple should return an error for N is not of type posint # # It seems that Sample uses floor(N) N := 10.49; type(N::posint); P := 1/2: X := RandomVariable(Binomial(N, P)): Mean(X), N*P; ProbabilityFunction(X, k); S := Sample(X, 10^6): Mean(S); # A non consistent result (only non negative values of k should be accepted) eval(ProbabilityFunction(X, k), k=evalf(Pi));
 (4)

NEGATIVE BINOMIAL DISTRIBUTION

 > X := RandomVariable(NegativeBinomial(n, p)): L := [attributes(X)][3]: A := exports(L): L:-Conditions
 (5)
 > N := 10.49: P := 1/2: X := RandomVariable(NegativeBinomial(N, P)): Mean(X)