Question: questions D,E,F 3. A magic matrix is a square matrix with the property that each row, each column and each diagonal have the same sum.

questions D,E,F 3. A magic matrix is a square matrix with thequestions D,E,F

3. A magic matrix is a square matrix with the property that each row, each column and each diagonal have the same sum. Create a 55 magic matrix named a. Answer the following with supporting evidence (hint: do the magic check!). (5+5+5+10+7+8 points) a) Is a times a constant such as 2 also a magic matrix? b) If you square each element of a, is the new matrix a magic matrix? c) If you add a constant to each element, is the new matrix a magic matrix? d) Create a 1010 matrix out of the following components (see Figure): - The matrix a - 2 times the matrix a - A matrix formed by squaring each element of a - 2 plus the matrix a Is your result a magic matrix? (Optional) Does the order in which you arrange the components affect your answer? e) Exchange the top left corner and bottom right corner elements of the matrix a and store the resulting matrix in b. Note that this should work with a general magic matrix of any size. (i.e. your answer should not be specific to a 55 matrix) ones everywhere else. Do this efficiently, so that if you had to create a 100x100 matrix instead, you wouldn't have to change your code much. You are welcome to use loop or non-loop strategies

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!