1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I Minimize |n-2^x*3^y| over the integer

  1. Jul 9, 2016 #1
    Hi,
    Is there a way to formulate the solution of minimization of:
    abs(n-2^x*3^y)
    Over integers x and y for any given integer n?
    A numeric example that I found by trial and error is:
    |6859-2^8*3^3|=53

    Thanks in advance.
     
  2. jcsd
  3. Jul 9, 2016 #2

    Mark44

    Staff: Mentor

    That's hardly a minimum value. If n = x = y = 1, the result is |-5| = 5
    If n = 6 and x = y = 1, the result is 0, which would be minimum value for the parameter n = 6.

    Have you studied calculus? In particular multivariate calculus? There are a couple of techniques that can be used to function the minimum or maximum of a function of two variables. There is also the technique of Lagrange multipliers.
     
  4. Jul 9, 2016 #3
    Hi Mark44,
    n is not meant to be a variable. It is a known integer value and the problem is to solve for integer variables x and y such that the result has smallest integer value. So for my numeric example n can only be 6859. x and y can be any integers. the minimization solution is x=8 and y= 3, because no other integer values of x and/or y will result in a number less than 53.
    As far as I know calculus does offer solutions over the rational field but not over the integer field.
    Would the Lagrange multipliers offer a general solution for this?
    Thank you for the reply.
     
    Last edited: Jul 9, 2016
  5. Jul 9, 2016 #4
    I don't expect there to be a known solution for this. I am just looking for expert-confirmation or authoritative-reference on the subject.
     
  6. Jul 10, 2016 #5

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Positive integers? Otherwise there is no minimum.

    Minimizing abs(2^x-3^y) apart from the case |8-9|=1 is still an open problem. Your problem doesn't look easier.

    log(n)=x*log(2)+y*log(3) and some approximation techniques could help to reduce the number of cases to test.
     
  7. Jul 10, 2016 #6
    Thank you for the reply mfb.
    The log formula is very interesting.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Minimize |n-2^x*3^y| over the integer
  1. X^n +y^n (Replies: 5)

Loading...