Given:
You will be given 2 parameters: I and P. You must deduce two additional parameters: i and N.
N is a matrix of dimension (1, i) that contains the natural numbers in ascending order. (i.e. if i = 7 then N = [1, 2, 3, 4, 5, 6, 7]).
I will always be a permutation of N, and therefore also has dimensions (1, i). (i.e. if i = 7, then I *could* be equal to I = [2, 5, 3, 1, 4, 6, 7]).
By definition, there will exist factorial(i) permutation matrices. You are given a subset of those matrices, denoted P, which also by definition, has dimensions (i, i).
You will be given I and P in the form of CSV files (delimited by commas). I will have the name "[login to view URL]" and for each P, the file names will go on as "[login to view URL]", "[login to view URL]", "[login to view URL]" and so on, up to the subset of P's given to you.
i and N are obviously easily deduced from I alone.
Problem:
Your algorithm must output a sequence of P (denoted as S(P) in this text) such that when dotted with I in the given order, produces a result equal to N (Here, dotted means the dot product).
The exact way S(P) is outputted doesn't matter, as long as the order is discernible in the way I should be dotted with S(P).
Example:
p0 = [[1, 0, 0], [0, 0, 1], [0, 1, 0]]. p1 = [[0, 1, 0], [1, 0, 0], [0, 0, 1]]. I = [3, 1, 2].
The correct answer is S(P) = (p1, p0). Why? because (I * p1) * p0 = N. Notice that (I * p0) * p1 DOES NOT EQUAL N, therefore S(P) = (p0, p1) is incorrect.
Requirements to be accepted:
Complete this practice problem (the parameters here are not in CSV file format; it's just a google doc). You can either directly message me the answer or provide the solution in your project proposal (remember, Freelancer.com allows you to edit them). Link: [login to view URL]
Although I do not specifically require it as long as you can solve the problem, a background in linear algebra and algorithmic programming will help you.