-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formula for tiling a chessboard with dominos #11533
Comments
|
The 2 x 3 case also gives a wrong answer. It must be wrong somewhere in auto-simplification: |
|
It seems that the formula is not quite correct. The product can be negative. The absolute value should be taken: |
|
Supposedly it doesn't. I'll need to work out an example by hand to check. Regardless, something is wrong for the 2 x 2 case where simplify and evalf disagree. |
|
I modified the formula to not take a square root and Unless there is some other bug, it seems you are right for the 2 x 3 case. |
|
Latest development version seems to give correct answer(2). |
|
Indeed, it no longer incorrectly splits the square root |
|
And even |
See http://www.johndcook.com/blog/2016/08/19/how-many-ways-can-you-tile-a-chessboard-with-dominoes/. The function from the post can be adapted for SymPy:
This is a nice testbed for simplify, especially
trigsimp. The 2 x 2 case gives a wrong answer!The 4 x 4 case takes a lot of work to be simplified. Just
simplifydoesn't do it. I hit a bug withsqrtdenest:To actually simplify it, the only way I found was to kill the outer square root and simplify first.
I tried
expand_complexbut that just produced a huge expression with a bunch of cosines of arctangents.The 8 x 8 version seems to be too hard. It doesn't know how to reduce the cosines (like
cos(pi/9)). Of course, you can get the answer usingevalf, but I can't get it to symbolically simplify.The text was updated successfully, but these errors were encountered: