<s>
In	O
probability	O
theory	O
and	O
statistics	O
,	O
Wallenius	B-General_Concept
 '	I-General_Concept
noncentral	I-General_Concept
hypergeometric	I-General_Concept
distribution	I-General_Concept
(	O
named	O
after	O
Kenneth	O
Ted	O
Wallenius	O
)	O
is	O
a	O
generalization	O
of	O
the	O
hypergeometric	O
distribution	O
where	O
items	O
are	O
sampled	O
with	O
bias	O
.	O
</s>
<s>
The	O
number	O
of	O
red	O
balls	O
x1	O
that	O
we	O
get	O
in	O
this	O
experiment	O
is	O
a	O
random	O
variable	O
with	O
Wallenius	B-General_Concept
 '	I-General_Concept
noncentral	I-General_Concept
hypergeometric	I-General_Concept
distribution	I-General_Concept
.	O
</s>
<s>
Wallenius	B-General_Concept
 '	I-General_Concept
noncentral	I-General_Concept
hypergeometric	I-General_Concept
distribution	I-General_Concept
is	O
obtained	O
if	O
balls	O
are	O
sampled	O
one	O
by	O
one	O
in	O
such	O
a	O
way	O
that	O
there	O
is	O
competition	O
between	O
the	O
balls	O
.	O
</s>
<s>
Closed	O
form	O
expressions	O
for	O
the	O
probability	O
mass	O
function	O
exist	O
(	O
Lyons	O
,	O
1980	O
)	O
,	O
but	O
they	O
are	O
not	O
very	O
useful	O
for	O
practical	O
calculations	O
because	O
of	O
extreme	O
numerical	B-Algorithm
instability	I-Algorithm
,	O
except	O
in	O
degenerate	O
cases	O
.	O
</s>
<s>
Several	O
other	O
calculation	O
methods	O
are	O
used	O
,	O
including	O
recursion	O
,	O
Taylor	O
expansion	O
and	O
numerical	B-Algorithm
integration	I-Algorithm
(	O
Fog	O
,	O
2007	O
,	O
2008	O
)	O
.	O
</s>
<s>
The	O
probabilities	O
of	O
all	O
(	O
x	O
,	O
n	O
)	O
combinations	O
on	O
all	O
possible	O
trajectories	B-Application
leading	O
to	O
the	O
desired	O
point	O
are	O
calculated	O
,	O
starting	O
with	O
f(0,0 )	O
=	O
1	O
as	O
shown	O
on	O
the	O
figure	O
to	O
the	O
right	O
.	O
</s>
<s>
The	O
probability	O
mass	O
function	O
can	O
be	O
calculated	O
by	O
various	O
Taylor	O
expansion	O
methods	O
or	O
by	O
numerical	B-Algorithm
integration	I-Algorithm
(	O
Fog	O
,	O
2008	O
)	O
.	O
</s>
<s>
The	O
best	O
known	O
method	O
is	O
to	O
approximate	O
the	O
multivariate	O
Wallenius	B-General_Concept
distribution	I-General_Concept
by	O
a	O
multivariate	O
Fisher	O
's	O
noncentral	O
hypergeometric	O
distribution	O
with	O
the	O
same	O
mean	O
,	O
and	O
insert	O
the	O
mean	O
as	O
calculated	O
above	O
in	O
the	O
approximate	O
formula	O
for	O
the	O
variance	O
of	O
the	O
latter	O
distribution	O
.	O
</s>
<s>
The	O
balls	O
that	O
are	O
not	O
taken	O
in	O
the	O
urn	O
experiment	O
have	O
a	O
distribution	O
that	O
is	O
different	O
from	O
Wallenius	B-General_Concept
 '	I-General_Concept
noncentral	I-General_Concept
hypergeometric	I-General_Concept
distribution	I-General_Concept
,	O
due	O
to	O
a	O
lack	O
of	O
symmetry	O
.	O
</s>
<s>
The	O
distribution	O
of	O
the	O
balls	O
not	O
taken	O
can	O
be	O
called	O
the	O
complementary	O
Wallenius	B-General_Concept
 '	I-General_Concept
noncentral	I-General_Concept
hypergeometric	I-General_Concept
distribution	I-General_Concept
.	O
</s>
<s>
in	O
Mathematica	B-Language
.	O
</s>
<s>
An	O
implementation	O
for	O
the	O
R	B-Language
programming	I-Language
language	I-Language
is	O
available	O
as	O
the	O
package	O
named	O
.	O
</s>
<s>
Implementation	O
in	O
C++	B-Language
is	O
available	O
from	O
.	O
</s>
