       Re: random matrix from row and column sums

• To: mathgroup at smc.vnet.net
• Subject: [mg53831] Re: random matrix from row and column sums
• From: "Valeri Astanoff" <astanoff at yahoo.fr>
• Date: Sat, 29 Jan 2005 06:02:39 -0500 (EST)
• References: <csinpt\$njk\$1@smc.vnet.net><200501200847.DAA04066@smc.vnet.net> <csqqs1\$1mh\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Bob,

Your solution is by far faster than mine, but what kind of random is
it?

Consider this example :
[...]
In:=
bob=Table[randomFill[{10,10,10,10,10},{10,10,10,10,10}],{100}]//Flatten;

In:=
BinCounts[bob,{-1,10}]
Out=
{1147,355,224,191,134,117,105,68,70,53,36}

In:=
val=Table[rand[{10,10,10,10,10},{10,10,10,10,10}],{100}]//Flatten;

In:=
BinCounts[val,{-1,10}]
Out=
{348,613,740,445,226,102,24,2,0,0,0}

In:=
rep=N[{Mean[#],Mode[#],Median[#],StandardDeviation[#],Skewness[#]}]&;

In:=
rep[bob]
Out=
{2.,0.,1.,2.64809,1.33292}

In:=
rep[val]
Out=
{2.,2.,2.,1.37228,0.525969}

With your fast but too much skewed solution 0 is three times
more likely to occur than 1 and five times more likely to occur than 2,

which is the mean (and is also the mode and median with my solution).
I wonder whether it is what the initial poster expected...

Valeri

```

• Prev by Date: Re: position of letters in a string
• Next by Date: Re: Solving matrix equation
• Previous by thread: Re: Re: random matrix from row and column sums
• Next by thread: Re: Re: random matrix from row and column sums