BMAD 63 Report post Posted March 2, 2013 Consider a rectangular M x N checker board and some checkers on it. What is the minimum number of checkers you should put on the board for any straight line parallel to any one of two sides of the board would cross some (at least one) checker? Quote Share this post Link to post Share on other sites
0 BobbyGo 7 Report post Posted March 5, 2013 If I'm reading this right... The minimum number of checkers would be equal to the larger of the two values. c = # of checkers needed c = m ((((m-n)/(|m-n|))+1)/2) + n ((((n-m)/(|n-m|))+1)/2) This should work if m does not equal n, but will error out if m and n are equal. Not quite sure how to get around that in a closed form expression. Quote Share this post Link to post Share on other sites
0 BobbyGo 7 Report post Posted March 6, 2013 Here is the amended equation that should return the desired outcome of the larger of the two input values, m or n. This assumes a few things: Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!) The factorial of 0 equals 1. I haven't messed up anywhere. *Items 2 and 3 are supported by WolframAlpha ( 0! = 1 ; -5! = -120 ; -6! = -720 ; -7! = -5040 ; etc... ), but don't seem to be uniformly accepted elsewhere. Quote Share this post Link to post Share on other sites
0 k-man 26 Report post Posted March 6, 2013 Here is the amended equation that should return the desired outcome of the larger of the two input values, m or n. This assumes a few things: Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!) The factorial of 0 equals 1. I haven't messed up anywhere. *Items 2 and 3 are supported by WolframAlpha ( 0! = 1 ; -5! = -120 ; -6! = -720 ; -7! = -5040 ; etc... ), but don't seem to be uniformly accepted elsewhere. math1.gifmath2.gif why so complicated? c=(m+n+|m-n|)/2 Quote Share this post Link to post Share on other sites
0 bushindo 14 Report post Posted March 6, 2013 Here is the amended equation that should return the desired outcome of the larger of the two input values, m or n. This assumes a few things: Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!) The factorial of 0 equals 1. I haven't messed up anywhere. *Items 2 and 3 are supported by WolframAlpha ( 0! = 1 ; -5! = -120 ; -6! = -720 ; -7! = -5040 ; etc... ), but don't seem to be uniformly accepted elsewhere. math1.gifmath2.gif Comments on point 2. and 3. The factorial of 0 is indeed 1 by convention. As for the assumption (-z)! = -(z!) for a positive z, it is not true. Check out the gamma function, which is the extension of the factorial function to real and complex numbers. The gamma function is undefined at non-positive integers. I suspect Wolfram Alpha is interpreting your testing inputs as -1 * (z!). For instance, -1*(5!) = -120 ; -1*(6!) = -720 ; -1*(7!) = -5040. Quote Share this post Link to post Share on other sites
Consider a rectangular M x N checker board and some checkers on it. What is the minimum number of checkers you should put on the board for any straight line parallel to any one of two sides of the board would cross some (at least one) checker?
Share this post
Link to post
Share on other sites