Purchase Solution

Magic Matrix

Not what you're looking for?

Ask Custom Question

Magic matrix
A N*N matrix is called a magic matrix if it is filled with numbers in {1.. N^2} and sum of the values in all rows, columns are equal.

Supposing an odd N, we are planing to describe how to create such a matrix.
Example of such a matrix is as following:

Purchase this Solution

Solution Summary

A comprehensive step by step agorithm tries to show how to create a N*N magic matrix for odd values of N.

Solution Preview

Select an arbitary cell in matrix ad start with 1.
| |
| |
| 1 |

cell (i,j)=(3,1) is selected. The next number will be placed in the cell (i-1) and(j-1). If this cell is out of bound, i.e

if i-1 <0 then i=N
if j-1 < 0 ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C++ Operators

This quiz tests a student's knowledge about C++ operators.