Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I need to build an algorithm that gets 3 numbers like 10,20,30 for example and build new matrix that contains 3 squares that contains this numbers(for example one square with size 2*5(slot sum is 10) that contains in every slot "10" and more one square with size 5*4(slot sum is 20) that......) in wish to build each one of this 3 squares most Equilateral square like and the matrix in wish to be most Equilateral square like too, and the matrix can have 1 empty slot or remove maximum 1 slot from the 3 squares sum of slot to do that.
How i can do this?!!?
Any point to start with like mathematical idea or something?
Thanks alot!



In short how i add 3 matrixes to new one by the rules:
Each one of the 3 matrices need to add to the new matrix as square how much close to Equilateral square.
The new matrix can't contain more than 1 empty/death slot.
The new matrix can delete 1 slot from the sum of the 3 matrixes to to that.
The new matrix need to be most close as can to Equilateral!!
Now the question more understandable?
again thanks!
Posted
Updated 14-Aug-13 10:30am
v5
Comments
Sergey Alexandrovich Kryukov 13-Aug-13 15:45pm    
What do you mean "how"? By doing some programming work. http://www.whathaveyoutried.com? What's the problem?

And one example is not a description. If you want to describe some mathematical/algorithm problem, you really need to be very formal and should not be afraid of telling it all in detail.

Besides, what do you mean by "quadrilateral"? It could be a polygon with 4 sides, or a configuration with 4 lines and 6 points, or something else...

—SA
Member 10207695 13-Aug-13 16:51pm    
I edited the question.
BacchusBeale 13-Aug-13 20:34pm    
Do you mean matrix multiplication where T = transpose, e.g. (a b c) * (d e f)T = (10 20 30)?
Member 10207695 14-Aug-13 15:16pm    
Hello
Thanks for your answer.
I edited the question to be more understandable can you look again? because i think your answer is the solve but i need that you will be more specific.

First, aren't all squares equilateral? From your new description sounds like you need to add 3 matrices to make a matrix whose entries are square numbers: A + B + C = D, so for the first entry a11 + b11 + c11 = d11 and d11 = n^2, for some n. Look here: http://www.purplemath.com/modules/mtrxadd.htm.
 
Share this answer
 
Comments
Member 10207695 14-Aug-13 17:32pm    
They are square but not must be equilateral.
The link you have gave broken.
again: thanks
You could make a function that divides the number a number of times and sees which one gives you an even number, just an idea though.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900