subject
Computers and Technology, 30.10.2019 02:31 adiaz97

In a previous assignment we worked on an algorithm that produced magic squares of odd order. we avoided generating magic squares of even order because the algorithm for generating them is more complicated. here is a very famous magic square that is featured in the painting melancholia by albrecht durer. 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1 in this assignment you will generate onlyten magic squares of order 4 through permutation. the process is straight forward but time consuming. here are the steps: create a 1-d list of integers 1 through 16. permute this list of integers. for each permutation convert the 1-d list into a 2-d list that is 4 x 4. check if that 2-d list is a magic square. if it is, then print it out. stop when you have gone through all the permutations.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
In the film "epic 2015," epic is the name for:
Answers: 3
question
Computers and Technology, 22.06.2019 12:10
1. package newton’s method for approximating square roots (case study 3.6) in a function named newton. this function expects the input number as an argument and returns the estimate of its square root. the script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key. 2. convert newton’s method for approximating square roots in project 1 to a recursive function named newton. (hint: the estimate of the square root should be passed as a second argument to the function.) 3. elena complains that the recursive newton function in project 2 includes an extra argument for the estimate. the function’s users should not have to provide this value, which is always the same, when they call this function. modify the definition of the function so that it uses a keyword parameter with the appropriate default value for this argument, and call the function without a second argument to demonstrate that it solves this problem. 4. restructure newton’s method (case study 3.6) by decomposing it into three cooperating functions. the newton function can use either the recursive strategy of project 1 or the iterative strategy of case study 3.6. the task of testing for the limit is assigned to a function named limitreached, whereas the task of computing a new approximation is assigned to a function named improveestimate. each function expects the relevant arguments and returns an appropriate value. 5. a list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor. define a predicate issorted that expects a list as an argument and returns true if the list is sorted, or returns false otherwise. (hint: for a list of length 2 or greater, loop through the list and compare pairs of items, from left to right, and return false if the first item in a pair is greater.)
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
You know the right answer?
In a previous assignment we worked on an algorithm that produced magic squares of odd order. we avoi...
Questions
question
Mathematics, 03.03.2021 21:20
question
Mathematics, 03.03.2021 21:20
question
Biology, 03.03.2021 21:20
question
Mathematics, 03.03.2021 21:20
question
Mathematics, 03.03.2021 21:20
question
Mathematics, 03.03.2021 21:20
Questions on the website: 13722359