Re: ack! simple partitioning problem making my head swim....
- To: mathgroup at smc.vnet.net
- Subject: [mg42084] Re: [mg42050] ack! simple partitioning problem making my head swim....
- From: Bobby Treat <drmajorbob-MathGroup3528 at mailblocks.com>
- Date: Wed, 18 Jun 2003 02:11:14 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
The two lists represent matrices that can be multiplied, if and only if
the two lengths have a common integer factor. That factor would be the
number of columns of the first matrix, the number of rows of the second.
Since the common factor can be 1, the answer is that two lists ALWAYS
represent matrices that can be multiplied.
Bobby
-----Original Message-----
From: cdj <a_cjones at hotmail.com>
To: mathgroup at smc.vnet.net
Subject: [mg42084] [mg42050] ack! simple partitioning problem making my head
swim....
Hi all, 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 (just as
in the Mathematica command Flatten[{{1,2},{3,4}}] = {1,2,3,4}. (a) It's
clear enough that finding a solution to this problem is gonna involve
comparing the factors in the lengths of the two lists, but then it all
goes wishywashy in my head. lil help? (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? thanks a bunch for any insights,
cdj