Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: CarTalk Puzzler

by tilly (Archbishop)
on Nov 17, 2005 at 16:57 UTC ( [id://509469]=note: print w/replies, xml ) Need Help??


in reply to Re: CarTalk Puzzler
in thread CarTalk Puzzler

Your conclusion is good, but your reasoning is not. For instance 8 is a number which is not a perfect square yet has a repeated factor.

A correct way of reasoning this goes as follows:

  1. The number of times the n'th light is pulled is the same as its number of factors.
  2. It will be on if and only if there are an odd number of factors.
  3. If you write out the prime factorization of a number, P1n1 * P2n2 * ... * Pmnm, then the number of factors the number has is (i1 + 1)(i2 + 1)...(im + 1)
  4. This is odd if only if i1, i2, ... , im are all even.
  5. This is true if and only if n is a perfect square.
  6. From 2) and 5), the n'th light is on if and only if n is a perfect square.

Replies are listed 'Best First'.
Re^3: CarTalk Puzzler
by dragonchild (Archbishop) on Nov 17, 2005 at 17:02 UTC
    The term "factor" for a non-mathematician (which was my intended audience) is "any number that you multiply by a single other number to get the original number". In the case of 8, 2 is a repeated factor mathematically, but the factors of 8 (according to the gradeschool definition) are 1, 2, 4, and 8 - 4 factors without repetition.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      Mathematicians have the same definition of factor as what you used. It is your definition of repeated factor that I was confused about. To me if f divides n, and f divides n/f, then f is a repeated factor of n. It seems from your description that to you say that f is a repeated factor of n if and only if f*f=n.

      That isn't confusing in a "non-mathematician vs mathematician" way. That is confusing in a "you used a phrase that described what you meant without noticing that it was very ambiguous" way. That is, I am confident that I would not have understood that as you intended back in highschool. And I was likewise not confused when I first saw the phrase "this factor is repeated 3 times".

      In ths case your reasoning has a non-obvious step from "odd number of factors" to "one factor must be the square root of the number". It is easy enough to fill that in - just add a comment that you can pair off factors by putting i with j if i*j=n, and you will have a left-over if and only if there is a factor i with i*i=n. But since that pairing is the key step, it needs to actually be stated. You can't expect other people to have that flash of brilliance.

        I've seen math texts for beginners that present factors as occuring pairs. For instance, 12 can be factored 1*12=12, 2*6=12, 3*4=12, giving factors 1,2,3,4,6,12. Perhaps this is the source of this use of "repeated"; a number such as 16 is factored 1*16=16, 2*8=16, 4*4=16, giving "factors" 1,2,4,4,8,16.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-24 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found