3. The Subirachs Magic Square-pictured below-is an interesting construction. While not technically a magic square, its...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. The Subirachs Magic Square-pictured below-is an interesting construction. While not technically a magic square, its rows, columns, diagonals, corners, center, and "postage stamps" do all have the same sum. In fact, there are many other combinations in the square that also have this sum. (47 Points) Write a Java program that counts all the 4-element combinations that have the same sum as the rows/columns, etc. Add to your program so that you can count all combinations with this sum. Some will have fewer than 4 elements, some will have exactly 4 elements, some will have more than 4 elements. Count them all. Make yet another addition to your program that counts the number of ways every possible sum can be formed. Include 0 as a possible sum; the largest sum will be created by summing every cell of the square. What sum can be created with the greatest number of combinations, and how many combinations is that? Notice anything interesting about that? 3. The Subirachs Magic Square-pictured below-is an interesting construction. While not technically a magic square, its rows, columns, diagonals, corners, center, and "postage stamps" do all have the same sum. In fact, there are many other combinations in the square that also have this sum. (47 Points) Write a Java program that counts all the 4-element combinations that have the same sum as the rows/columns, etc. Add to your program so that you can count all combinations with this sum. Some will have fewer than 4 elements, some will have exactly 4 elements, some will have more than 4 elements. Count them all. Make yet another addition to your program that counts the number of ways every possible sum can be formed. Include 0 as a possible sum; the largest sum will be created by summing every cell of the square. What sum can be created with the greatest number of combinations, and how many combinations is that? Notice anything interesting about that?
Expert Answer:
Answer rating: 100% (QA)
import javautil public class MagicSquareCombinations private static int magicSquare 16 3 ... View the full answer
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
1. How strong are the competitive forces confronting J. Crew in the market for specialty retail? Do a [Michael Porter] five-forces analysis to support your answer. (see chapter 3 in the textfor...
-
1. Locate a current financial news article using a source such as the following: a. www.reuters.com; b. www.yahoo.com/finance; c. http://www.msn.com/en-us/money d. www.bloomberg.com 2. Use the...
-
Lowry Company has sales of $125,000, cost of goods sold of $70,000, operating expenses of $20,000, average invested assets of $400,000, and a hurdle rate of 8 percent. Calculate Lowry's return on...
-
MJ Logistics has decided to build a new warehouse to support its supply chain activities. They have the option of building either a large warehouse or a small one. Construction costs for the large...
-
Use the following steps to establish a relationship between the coefficient of determination and the correlation coefficient. a. Show that \(\widehat{y}_{i}-\bar{y}=b_{1}\left(x_{i}-\bar{x} ight)\)....
-
In the chapter, we stated that there are countless possible measures of process performance, many of which are derived from the four core measures quality, cost, time, and flexibility. In the...
-
1.Given MPC (marginal propensity to consume) = 0.75, if the government implements an expansionary fiscal policy as (a) cutting taxes by $10 billion, then by how much would total spending increase...
-
Q1) The vapour pressure, p, of nitric acid varies with temperature as follows: 0/C 0 20 40 50 70 80 90 100 p/kPa 1.92 6.38 17.7 27.7 62.3 89.3 124.9 170.9 What are: (a) the normal boiling point (b)...
-
If \(n \geq 3\), then every \(n \times n\) matrix with any repeated eigenvalues is defective. (True/False)
-
Choose a partner. Together, develop an innovative product or service that will be popular in the year 2025. As you develop your product or service, ask yourselves the following questions: 1. What...
-
Find a specific job, internship, or graduate study listing that you would be interested in pursuing. Make sure it requires a letter of recommendation. Your task is to request a letter of...
-
The shifted norm referred to in the readings means that we have an acceptable level of conduct beyond what laws and regulations require. For example, the North Carolina State Troopers have a motto or...
-
Suppose you were given the following information about two inflationtargeting economies. Economy A has been volatile historically with the unemployment rate fluctuating widely around the natural...
-
A car goes 24 miles due north then 7 miles due east. What is the straight distance between the car's starting point and end point?
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
Find an LU decomposition of the matrix? Figure 28.2? The operation of LUP-DECOMPOSITION. (a) The input matrix A with the identity permutation of the rows on the left. The first step of the algorithm...
-
Professor Gekko has always dreamed of inline skating across North Dakota. He plans to cross the state on highway U.S. 2, which runs from Grand Forks, on the eastern border with Minnesota, to...
-
Give a real-world example that requires sorting or a real-world example that requires computing a convex hull.
-
Write a one-page summary addressing the topic, How improving safety and health at the Hotel Paris will contribute to us achieving our strategic goals.
-
Based on what you read in this chapter of Dessler, Human Resource Management, whats the first step you would have advised the Hotel Paris to take as part of its new safety and health program, and why?
-
How would you suggest the Carters get all employees to behave more safely at work? Also, how would you advise them to get those who should be wearing goggles to do so?
Study smarter with the SolutionInn App