BrainDen.com - Brain Teasers

## Question

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?

## Recommended Posts

• 0

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.

##### Share on other sites
• 0

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:

1. Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board.
2. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!)
3. The factorial of 0 equals 1.
4. 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.

##### Share on other sites
• 0

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:

1. Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board.
2. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!)
3. The factorial of 0 equals 1.
4. 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.gif math2.gif

why so complicated?

c=(m+n+|m-n|)/2

##### Share on other sites
• 0

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:

1. Given m and n, the largest value presented is the minimum number of checkers needed to be placed on the board.
2. The factorial of a negative number will be equal to the negative value of the factorial of that number's positive counterpart. -z! = -(z!)
3. The factorial of 0 equals 1.
4. 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.gif math2.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.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×