This problem may take some time...and programming.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hunderpanzer
    New Member
    • Jul 2007
    • 60

    This problem may take some time...and programming.

    I was just looking around on this site, and went into the Jobs category.

    I clicked on an interesting job advertisement for BitTorrent - I'm sure we all know what that is, and as a test, the employer wanted someone to give the answer to a problem which would prove their understanding of their math (maybe not so much) and python programming skills.

    Don't worry, I'm not looking to steal the answer and take the job. I know nothing of Python, but perhaps it can be done in another language ?

    Here it is. Let's see some results, and maybe some code used ?



    What is the exponent of the largest power of two whose base seven representation doesn't contain three zeros in a row?

    Good Luck!
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Since the job is over 2 months old, it's probably not still available anyway.

    Comment

    • Hunderpanzer
      New Member
      • Jul 2007
      • 60

      #3
      Originally posted by mmccarthy
      Since the job is over 2 months old, it's probably not still available anyway.
      True, but I've seen some pretty interesting math puzzles in this area of the forum, so I thought it would be cool to share it.

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by Hunderpanzer
        True, but I've seen some pretty interesting math puzzles in this area of the forum, so I thought it would be cool to share it.
        True, we do have some maths geniuses around.

        Comment

        • Banfa
          Recognized Expert Expert
          • Feb 2006
          • 9067

          #5
          Originally posted by Hunderpanzer
          What is the exponent of the largest power of two whose base seven representation doesn't contain three zeros in a row?
          Not as easy as it sounds, Python probably unqiuely suited to this problem, this is because most programming languages have a mimited set of integer types, for instance C/C++ typically has

          8 bit integers
          16 bit integers
          32 bit integers
          64 bit integers

          If you need anything else this needs to be programmed around. This is true for most languages, they have a set of limited integers, however Python has 2 types of integer

          32 bit
          any size you want

          The second type clearly gives a very large problem domain, if you look at the base 7 representations of the first 31 powers of 2 (numbers fitting into a signed 32 bit int) none of them have 3 consecutive zeros.

          The first question has to be

          Are there any powers of 2 which have 3 consecutive 0s in their base 7 representation?

          Assuming the answer to that is yes the question then makes an assumption:
          At some value N the base severn representation of 2 ** x for all x >= N contains at least 3 consecutive 0s.

          This statement is not self evidently true to me however assuming that it is true then you need to find the minimum value of N and then the answer will be N-1.

          Personally I would say thorum solving like this involves mainly maths with little need for programming. In fact I think it would be very hard to write a program to some this to be true, you need to some something to be true for all x >= N not something a computer is very good at doing. Computers are good at doing something for all MIN_LIMIT <= x <= MAX_LIMIT but for this problem there is no max limit, a mathematical proof is required.

          Comment

          • Hunderpanzer
            New Member
            • Jul 2007
            • 60

            #6
            Originally posted by Banfa
            Not as easy as it sounds, Python probably unqiuely suited to this problem, this is because most programming languages have a mimited set of integer types, for instance C/C++ typically has

            8 bit integers
            16 bit integers
            32 bit integers
            64 bit integers

            If you need anything else this needs to be programmed around. This is true for most languages, they have a set of limited integers, however Python has 2 types of integer

            32 bit
            any size you want

            The second type clearly gives a very large problem domain, if you look at the base 7 representations of the first 31 powers of 2 (numbers fitting into a signed 32 bit int) none of them have 3 consecutive zeros.

            The first question has to be

            Are there any powers of 2 which have 3 consecutive 0s in their base 7 representation?

            Assuming the answer to that is yes the question then makes an assumption:
            At some value N the base severn representation of 2 ** x for all x >= N contains at least 3 consecutive 0s.

            This statement is not self evidently true to me however assuming that it is true then you need to find the minimum value of N and then the answer will be N-1.

            Personally I would say thorum solving like this involves mainly maths with little need for programming. In fact I think it would be very hard to write a program to some this to be true, you need to some something to be true for all x >= N not something a computer is very good at doing. Computers are good at doing something for all MIN_LIMIT <= x <= MAX_LIMIT but for this problem there is no max limit, a mathematical proof is required.
            I see. Maybe it's not such a great puzzle then.

            I'll keep an eye out for others.

            Comment

            Working...