433 Reputation

14 years, 116 days

M:=Matrix([[1,2,3],[2,3,4...

```M:=Matrix([[1,2,3],[2,3,4],[3,7,5]]);
[1    2    3]
[           ]
M := [2    3    4]
[           ]
[3    7    5]
```

what if i wanted to work out the diagonal from the other side. For example

3+3+3 = 9
2+2 = 4

1 = 1

4 +7 = 11

5 = 5

Is that possible?
The func with(MTM):=Diag works it out the normal way i want it to do it the other way.
1+3+5 = 9 -> diag(m)
2+4=6 -> diag(m,1)
2+7= -> diag(m,-1)

That's fantastic thank you...

That's fantastic thank you

That's fantastic thank you...

That's fantastic thank you

That's a great technique and...

That's a great technique and much more efficient than my proc. I thot it only applies to matrices (symmetry,rotation etc).

Thank you

That's a great technique and...

That's a great technique and much more efficient than my proc. I thot it only applies to matrices (symmetry,rotation etc).

Thank you

oh sory. I was trying to...

oh sory. I was trying to make a procedure which swaps the first two elements in the list and shift the third element to the end of the list. My procedure does this but it's quite long. I was wondering if it could be done more efficiently

L:= [ 1, 2, 3, 4, 5, 6] = > [ 2, 1, 4 , 5, 6, 3]

oh sory. I was trying to...

oh sory. I was trying to make a procedure which swaps the first two elements in the list and shift the third element to the end of the list. My procedure does this but it's quite long. I was wondering if it could be done more efficiently

L:= [ 1, 2, 3, 4, 5, 6] = > [ 2, 1, 4 , 5, 6, 3]

not on male 12...

I tried looking for it but its not in the database of maple 12's help?

not on male 12...

I tried looking for it but its not in the database of maple 12's help?

If i code this in maple...

If i code this in maple would it work for any size grid or will it only work an 8 by 8 grid??

1. Divide n by 12. Remember the remainder (n is 8 for the eight queens puzzle).
2. Write a list of the even numbers from 2 to n in order.
3. If the remainder is 3 or 9, move 2 to the end of the list.
4. Append the odd numbers from 1 to n in order, but, if the remainder is 8, switch pairs (i.e. 3, 1, 7, 5, 11, 9, …).
5. If the remainder is 2, switch the places of 1 and 3, then move 5 to the end of the list.
6. If the remainder is 3 or 9, move 1 and 3 to the end of the list.
7. Place the first-column queen in the row with the first number in the list, place the second-column queen in the row with the second number in the list, etc.

I just want to create a simple procedure that produces one of the unique solutions.

If i code this in maple...

If i code this in maple would it work for any size grid or will it only work an 8 by 8 grid??

1. Divide n by 12. Remember the remainder (n is 8 for the eight queens puzzle).
2. Write a list of the even numbers from 2 to n in order.
3. If the remainder is 3 or 9, move 2 to the end of the list.
4. Append the odd numbers from 1 to n in order, but, if the remainder is 8, switch pairs (i.e. 3, 1, 7, 5, 11, 9, …).
5. If the remainder is 2, switch the places of 1 and 3, then move 5 to the end of the list.
6. If the remainder is 3 or 9, move 1 and 3 to the end of the list.
7. Place the first-column queen in the row with the first number in the list, place the second-column queen in the row with the second number in the list, etc.

I just want to create a simple procedure that produces one of the unique solutions.

ok but ??...

Ok . that looks  very complecated to code lol. i want to code a similar program to this but i dnt really know how to go about it (still an amature at programming). I just want to create a program that displays a n*n matrix with ' n  ' number of   'Q''s on board. For example for a 4*4 matrix it displays 2 uniqe matrixes with for 4 queens  Q ' s (representin the number of qeens) and '0' 's (empty spaces)  or it displays a matrix with any unique solution and prints the total number of unique solutions. Any help would be greatly appreciated.

ok but ??...

Ok . that looks  very complecated to code lol. i want to code a similar program to this but i dnt really know how to go about it (still an amature at programming). I just want to create a program that displays a n*n matrix with ' n  ' number of   'Q''s on board. For example for a 4*4 matrix it displays 2 uniqe matrixes with for 4 queens  Q ' s (representin the number of qeens) and '0' 's (empty spaces)  or it displays a matrix with any unique solution and prints the total number of unique solutions. Any help would be greatly appreciated.