Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 A magic square is an arrangement of 4x4 integer numbers such that the addition of all the entries -numbers- in any of the

 

2 A magic square is an arrangement of 4x4 integer numbers such that the addition of all the entries -numbers- in any of the four rows and in any of the four columns yield the same value, say k. We say that the magic square is of order k. We call one such square a k-magic square. To find a magic 4x4 square and its order, we can use the following method. Given eight integer numbers A, B, C, D, W, X, Y, and Z form a 4x4 square according to the arrangement given in the Table 1. We find the order of this magic square by adding up the numbers in any of the rows or columns. Table 1: 4x4 Magic Square General Pattern C+W+Y B+X-Y B C A D D-W-Y A-X+Y A-W D+W-Z C-X+Z B+X D-X A-W+Z. B+X-Z C+W Let us call the task of finding a 4x4 magic square -and its order- given eight integer numbers "The 4x4 k-Magic Square Problem. - (2 pts) Identify and give a description of the problem's parameters. - - (2 pts) Give a statement describing a request for the construction of a 4x4 magic square and its order. - (3 pts)] Write a Python program that inputs values for the parameters of the problem and outputs what is requested in the problem statement. Include in your submission a file with the Python program to solve this problem. - (1 pt) Using your program, solve the instance given by 1, 2, 3, 4, 5, 6, 7 and 8. Submit the result of the execution of your program with this instance of the problem.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Matlab An Introduction with Applications

Authors: Amos Gilat

5th edition

1118629868, 978-1118801802, 1118801806, 978-1118629864

More Books

Students also viewed these Computer Network questions

Question

Where did the faculty member get his/her education? What field?

Answered: 1 week ago