• 0

Checker lines

Question

Posted · Report post

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?

0

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0

Posted · Report post

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.

0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

post-43582-0-34711500-1362516263_thumb.g

0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

post-43582-0-42412000-1362592302_thumb.gpost-43582-0-24761000-1362592303_thumb.g

0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

attachicon.gifmath1.gifattachicon.gifmath2.gif

why so complicated?

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

0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

attachicon.gifmath1.gifattachicon.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.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.