Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Random Matrix of Integers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48565] Re: [mg48544] Random Matrix of Integers
  • From: "Bruce W. Colletti" <bcolletti at compuserve.com>
  • Date: Sat, 5 Jun 2004 07:19:08 -0400 (EDT)
  • References: <NDBBJGNHKLMPLILOIPPOCECLEBAA.djmp@earthlink.net>
  • Sender: owner-wri-mathgroup at wolfram.com

David

Until Sasha replied, I had wanted RandomArray because it was supposedly the
best way to create random matrices.  Although Sasha showed how to do this
(DiscreteUniformDistribution was the key), he also showed it was slower than
the Table approach.

Your solution below reveals yet-another-thing I didn't know about
Mathematica:  the use of ampersand in Array.  This answers an unposted
question I had abandoned.  Thanks!

Bruce

----- Original Message ----- 
From: "David Park" <djmp at earthlink.net>
To: mathgroup at smc.vnet.net
Subject: [mg48565] RE: [mg48544] Random Matrix of Integers


>
> Bruce,
>
> Do you mean...
>
> Array[Random[Integer, {2, 9}] &, {4, 4}]
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
>
> From: Bruce W. Colletti [mailto:bcolletti at compuserve.com]
To: mathgroup at smc.vnet.net
>
> To create a 4x4 matrix of random integers drawn from {2..9}, I use:
>
>     A = Table[Random[Integer, {2, 9}], {4}, {4}]
> How can I do this using RandomArray?  Thanks.
>
> Bruce
>
>
>
>



  • Prev by Date: Re: Whats the Edgeworth expansion of a random vector?
  • Next by Date: Re: Re: Problem with the Derivative of a Arg-function
  • Previous by thread: Re: Random Matrix of Integers
  • Next by thread: RE: Re: Re: Random Matrix of Integers