Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Magic Square Project How to Create a Magic Square A magic square is a square with many smaller squares inside which contain one number in each square. The numbers in columns, rows, and diagonals each add up to equal the same number. To begin your magic square you first need to pick 9 numbers. These numbers can be in regular consecutive order, they can be in either odd or even consecutive order or they can be multiples of a number in consecutive order. Regular consecutive order example: 1, 2, 3, 4, 5, 6, 7, 8, 9 Odd consecutive order example: 1, 3, 5, 7, 9, 11, 13, 15, 17 Even consecutive order example: 2, 4, 6, 8, 10, 12, 14, 16, 18 Multiples of 4 in consecutive order example: 4, 8, 12, 16, 20, 24, 28, 32, 36 For my example I chose to do even consecutive order for my 9 numbers. 24, 26, 28, 30, 32, 34, 36, 38, 40 Second you need to decide on a matrix. It could be 3x3, 4x4, or 5x5 it is totally up to you what you want it to be but the higher the matrix is the more number combinations you are going to need. The matrix also affects the magic number. With a 3x3 which is what I will be using for my example you will need 8 number combinations. Third you have to find your magic number. This is when you add to get the sum of your 9 numbers, and then divide the sum by your matrix. I will divide my sum by 3 because I chose to do a 3x3 matrix. 24+26+28+30+32+34+36+38+40= 288 288÷3= 96 Therefore my magic number is 96. Next I have to come up with 8 combinations that all equal my magic number- 96. To figure out my first combination I will take my highest number and add it to the lowest number and then subtract that from 96 to find my missing number. 40+24= 64 96-64= 32 40+32+24=96 And there is your first combination! Now you only have to find 7 more. 1. 2. 3. 4. 5. 6. 7. 8. 40+32+24=96 40+30+26=96 38+32+26=96 38+34+24=96 38+30+28=96 36+34+26=96 36+32+28=96 34+32+30=96 After you find your combinations you count how many of each number you have. Number 24 26 28 30 32 34 36 38 40 # of times used in combination 2 3 2 3 4 3 2 3 2 The number used the most in the combinations goes in the middle of the squares. Because 32 is used in 4 combinations it will go in the middle square. 32 The next 4 numbers used the second most which would be used 3 times in the combinations will go in the corners. Remember you have to use your number combinations and all have to equal your magic number 96. The next 4 numbers used for the corners would be 26, 30, 34, and 38. 26 34 32 30 38 You have to figure out which number combinations will allow the number to go in that square and still add up to the magic number. You just plug your numbers in. 26 36 34 40 32 24 30 28 38 And that is how you make your magic square!