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
-
you should at least know the basics of one of its compatible programming languages, such as C#, C++/CLI,, Cobol, F#, or Visual Basic
-
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...
-
Lynch Company established a predetermined fixed overhead cost rate of $58 per unit of product. The company planned to make 7,000 units of product but actually produced only 6,500 units. Actual fixed...
-
What are the battery current I bat and the potential difference V a - V b between points a and b when the switch in FIGURE P28.55 is (a) Open (b) Closed? 24 V FIGURE P28.55
-
A company purchased equipment on 1 January 2004 for 40,000, at which date the relevant price index for equipment was 100. Depreciation is charged on a straight line basis at 25% per annum. The index...
-
Using the SoakNFun Swim Park information presented, do the following tasks. SoakNFun Swim Park sells individual and family tickets. With a ticket, each person receives a meal, three beverages, and...
-
Sales revenue Salaries expense Interest revenue Advertising expense Gain on sale of investments Cost of goods sold Insurance expense Interest expense Income tax expense Depreciation expense $ 424,000...
-
Darcelle teaches skiing at the Snow School. Jack runs a ski shop called Up Hill, Down Hill. Their combined bank interest is $1,000. If they get a refund, they would like the money deposited into...
-
Articles 1. https://www.bbc.com/news/business-47879798 2....
-
The accounting records of Sine.Com Ltd . provided the following for 2 0 X 9 : Balance in accounts receivable, 1 January 2 0 X 9 $ 9 0 , 0 0 0 Balance in accounts receivable, 3 1 December 2 0 X 9 1 2...
-
It's certainly true that when we're under the pressure of an immediate deadline, we're more likely to start working and work faster, but that doesn't mean we're working smarter, more effectively, or...
-
Explain the advancements in ground improvement techniques, such as jet grouting and deep soil mixing, and their role in enhancing soil properties for the construction of large-scale infrastructure...
-
The goose has a mass of 21.8 lb (pounds) and is flying at 10.4 miles/h (miles per hour). What is the kinetic energy of the goose in joules?
-
On March 1 5 , 2 0 2 3 , Mr . Driver, a calendar - year taxpayer, purchased and placed in service a light truck to be used in his business. The truck has an ADR midpoint of 8 years. The truck cost $...
-
Question at bottom of the article: Beyond the ABCs and 123s Jennifer Palmer10/9/2019 https://www.ncsl.org/research/human-services/social-and-emotional-development-in-early-learning-settings.aspx In...
-
Find a polar equation for the curve represented by the given Cartesian equation. 4y 2 = x
-
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.
-
Why and how do tax authorities get involved in the transfer pricing situation?
-
Assume a VAT situation where the tax rate is 15 percent, with export sales exempt. The manufacturer does not purchase inputs on which VAT has been paid, and its net selling price to the wholesaler...
-
A Galex Com pain, a manufacturer of stereo systems, started its production in October 2002. For the preceding 3 years Galex had been a retailer of stereo systems. Alter a thorough survey ol stereo...
Study smarter with the SolutionInn App