Thank you so much. This tutorial is the best. I would like to add just a little thing; The transpose of the magic square matrix follows the same properties discussed at the beginning of the video.
Hello... to try other video with good explain, also can you to download Excel file to resolve Square Magic 3x3 and 5x5. To Find on RU-vid as: Creación Cuadrado Mágico lado impar - Creating Magic Square odd side.
This algorithm is incorrect as it does not fully map the domain for magic squares {x ∈ Z : x > 2} (the set of all integers greater than 2). Instead, it maps {2x + 1 : x ∈ Z : x > 0} (the set of all positive odd integers), which is _half_ of the problem domain. The title and premise of this video, on the other hand, incorrectly state that the domain is the expected {x ∈ Z : x > 2}. A good programmer does not implement only half of a solution. Imagine if Windows only did _half_ of what you need it to do. Imagine if your favorite game ended abruptly at the _halfway_ point. Imagine if your OS kernel only allocated _half_ of the resources you requested. Imagine if the write syscall only wrote _half_ of the text you put in. Imagine if your lazy employee only did _half_ of the work you assigned to them. Oh wait, you're already doing that. I wouldn't even be criticizing you if the title wasn't misleading. That said, click here to see my implementation: gist.github.com/bradenbest/af3c83230e11cf1b5aaeb05598398df6 Not only did I fully (as of this edit) implement the problem domain (it works with any n > 2 that doesn't overflow when n^2 or n(n^2+1)/2 are applied), but I did it using a 1 dimensional array. That might seem crazy, but 1D arrays afford a lot of advantages over 2D arrays, especially when it comes to filling, copying and allocating space for them. The 4n + 2 orders were the most complicated to implement. I based my algorithm on this article: www.1728.org/magicsq3.htm
Also, rules iii. and iv. are overcomplicating things. The index can be expressed as `(n + i) mod n` where i is the index. Where n = 3 and % represents modulo division... (n + -3) % n = 0 % 3 = 0 (n + -2) % n = 1 % 3 = 1 (n + -1) % n = 2 % 3 = 2 (n + 0) % n = 3 % 3 = 0 (n + 1) % n = 4 % 3 = 1 (n + 2) % n = 5 % 3 = 2 (n + 3) % n = 6 % 3 = 0 As you can see, the expression correctly maps each value such that it "wraps" in both directions.
rotation, reverse and mirroring. The same rule is available for left-top shifts,right-bottom and left-bottom shifts as well as the top-right shifts shown in this video.
Using your formula for creating magic squares, I feel it is possible to derive the magic sum. Can you show the same ?! Another clarification i have is, what happens if the common difference between subsequent numbers is more than one ?? And, how will the formula for the magic sum be affected if the common difference is more than one ??
0 1 2 3 0 8 3 9 14 34 1 2 12 13 7 34 2 11 16 6 1 34 3 15 5 4 10 34 58 36 36 32 32 36 With the given rule, I have created this magic square. But all sum is not same. Kindly correct me if I am wrong.
Hi... to review other video, also can you to download Excel file to resolve Square Magic 3x3 and 5x5. To Find on RU-vid as: Creación Cuadrado Mágico lado impar - Creating Magic Square odd side. Grettings.
I guess for those even-degree cases, the four adjustment cases have some recursion relationship, for example when we violate the 4th case, then i++, j-=2, then we violate 1st, or 2nd case again. Perhaps we need to recursively check the violation until we get a full valid (i, j). Just a guess...
surely you mean "magic square of order 4", not "4-dimensional matrix", which means something completely different. en.wikipedia.org/wiki/File:Double-even_magic_construction.png www.math.wichita.edu/~richardson/mathematics/magic%20squares/even-ordermagicsquares.html
thank you sir.your teaching skills are amazing.can you please upload video of converting binary tree to sum tree only if values are greater for the relevant node ? recursivley ? it is very confuse . thank you
So I'm curious how does "3 by 2 equal 1" 3 minus 2 is 1 but he has a division symbol and 3 divided by 2 is 1.5, not 1. Can someone help me understand this??
sir, undoubtedly, algorithm explained by you is appreciabble. i am facing problem while costructiong a magic sq. of order 4........ as entry is becoming (2,-2).......what to do at this point ,,,,,,,,,