2 A magic square is an arrangement of 4x4 integer numbers such that the addition of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
Let r and s be solutions to the quadratic equation x 2 b x + c = 0. For n N, define d0 = 0 d1 = r s dn = b dn1 c dn2 (n 2) Prove that dn = r n s n for all n N. [4 marks] (b) Recall that a commutative...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
k) Assume that one of these portfolio's is the Market Portfolio and all portfolios, except Portfolio G, are fairly priced according to the CAPM. What is the highest utility score that can be achieved...
-
Would you argue that the traditionalist political sub-culture is still dominant in Texas or has there been a change? Assess how the traditionalist political sub-culture dominates (or not) Texas and...
-
Find the maximum shear stress in the throat of the weld metal in the figure. br> F 5000 lbf lin 2 in 8in tn in in lin lin
-
Youve just taken a job at the central bank and are given the job of calculating the appropriate nominal interest rate for a number of different Treasury bonds with different maturity dates. You have...
-
On January 1, 2017, Holland Corporation paid $8 per share to a group of Zeeland Corporation shareholders to acquire 60,000 shares of Zeeland's outstanding voting stock, representing a 60 percent...
-
1 Define Management? 2 Define Leadership? 234 4 Explain the Qualities of a successful leader? Define transformational leadership? 5 Explain about Decision making process? Explain the types of...
-
You need to write a paper in which you have to characterize the opportunities and challenge of Guinness
-
What are the distinctions between domestic and national, and gross and net?
-
What are the two types of unemployment described in the news clip? Why is one of them more worrying for officials in Singapore? Singapore has been facing increasing unemployment due to a slowdown in...
-
In the long run, how does Flight change its price and the quantity it produces? What happens to the market output of running shoes? Shows the situation facing Flight Inc., a producer of running...
-
GDP Outdated, Here Are the Alternatives A panel of highprofile economists suggest measuring the economic wellbeing of families and removing the emphasis on GDP growth. Some economists propose...
-
The Forbes Billionaires List: Africas Billionaires 2020 Africas billionaires are richer than a year ago. As a group, the continents 20 billionaires are worth $73.4 billion, an increase of $4.7...
-
Find the curvature of the curve T(4) = 3Sing + 3Cosw + 3Cotwk
-
How has the too-big-to-fail policy been limited in the FDICIA legislation? How might limiting the too-big-to-fail policy help reduce the risk of a future banking crisis?
-
Define x and y as symbolic variables and create the two symbolic expressions Use symbolic operations to determine the simplest form of S T. Use the subs command to evaluate the numerical value of...
-
Create the following matrix E: (a) Create a 2 3 matrix F from the second and third rows, and the third through the fifth columns of matrix E. (b) Create a 4 4 matrix G from all rows and the third...
-
In a one-dimensioni random walk, the position x of a walker is computed by: xj = xj + s where s is a random number. Write a program that calculates the number of steps required for the walker to...
-
In the second quarter of 2021, personal consumption expenditures, exports, and imports increased. Investment and government expenditure decreased. Real GDP increased by 6.5 percent following a 6.3...
-
When real GDP increased in the second quarter of 2021, consumption expenditure, exports, and imports increased. Fixed investment decreased, which included a decrease in business inventory investment....
-
Explain why higher stock prices and higher real estate values are equivalent to saving. U.S. household wealth grew to \($136.9\) trillion in the first quarter of 2021. Rising stock prices added...
Study smarter with the SolutionInn App