MathGroup Archive 2003

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

Search the Archive

Re: ack! simple partitioning problem making my head swim....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42118] Re: ack! simple partitioning problem making my head swim....
  • From: Bill Rowe <listuser at earthlink.net>
  • Date: Thu, 19 Jun 2003 04:00:09 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 6/17/03 at 5:43 AM, a_cjones at hotmail.com (cdj) wrote:

>I'm given 2 (ordered) lists - list1 has elements a_1,..a_n, and list2
>has elements b_1,...,b_n.

>As efficiently as possible, I want to determine whether or not these
>lists represent matrices that can be multiplied together. In list
>format, I'm imagining that "a list represents a matrix" means simply:
>the 1st row of the matrix are the first list entries, the second row
>comes next, and so on

Right. And you can test a symbol to see if it is a matrix with MatrixQ.

As for whether two matrices a,b can be multiplied together try

SameQ[Dimensions@a,Reverse@Dimensions@b]

>(b) Assume there does exist a way of partitioning the two input lists
>so that they form "multiplicatively-friendly" matrices. Is this
>guaranteed to be unique? Or is it possible that there be *several*
>ways to partition given lists into m-friendly matrices?

There will always be at least two ways to partition two lists to make matrices that can be multiplied. The number will increase as the number of prime factors in the length of each list.

To see a simple example of this try

a = Table[Random[], {6}];
b = Table[Random[], {6}];
Partition[a, 2].Partition[b, 3]
Partition[a, 3].Partition[b, 2]


  • Prev by Date: Re: Calculus Wiz Help
  • Next by Date: On capitalization
  • Previous by thread: Re: ack! simple partitioning problem making my head swim....
  • Next by thread: Re: Re: ack! simple partitioning problem making my head swim....