Results 1 to 7 of 7

Thread: Stupid math question!

  1. #1
    Join Date
    Jun 2004
    Location
    The Great NorthWet
    Posts
    13,749

    Stupid math question!

    Is there a way to solve xx = c without just trial and error?

    Backstory: Around 40 years ago another engineer and I at work were playing with our calculators. Those calculators had a maximum range of 9.99999999E99. If you hit one googol, out of range. Somehow we got wondering what was the largest number you could take to it's own power without going out of range. It took a couple of lunchtimes to get to the most digits we could put in. I still remember much of the number: 56.96124843, I think it was.
    Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt.

  2. #2
    Join Date
    Apr 2011
    Location
    Norfolk UK and some of me is in Northern France
    Posts
    7,991
    Those calculators don't do logs!
    sicut vis videre esto
    When we realize that patterns don't exist in the universe, they are a template that we hold to the universe to make sense of it, it all makes a lot more sense.
    Originally Posted by Ken G

  3. #3
    Join Date
    Jan 2002
    Location
    The Valley of the Sun
    Posts
    9,038
    I get about 56.96124 84322 60820 30512 22982 36945 72038 12195 56680 94908 79563 08808 98088 92097 88452 11000 doing a binary search. I don't what x is as a function of c.

  4. #4
    Join Date
    Jun 2004
    Location
    The Great NorthWet
    Posts
    13,749
    Wow! Um, what's a binary search?
    Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt.

  5. #5
    Join Date
    May 2007
    Location
    Earth
    Posts
    10,153
    Quote Originally Posted by Trebuchet View Post
    Wow! Um, what's a binary search?
    See https://www.cs.cmu.edu/~rjsimmon/151...-binsearch.pdf

    Information about American English usage here and here. Floating point issues? Please read this before posting.

    How do things fly? This explains it all.

    Actually they can't: "Heavier-than-air flying machines are impossible." - Lord Kelvin, president, Royal Society, 1895.



  6. #6
    Join Date
    Jun 2003
    Location
    SE Michigan
    Posts
    3,071
    Quote Originally Posted by Trebuchet View Post
    Wow! Um, what's a binary search?
    Sort of a divide-and-conquer technique.

    Take your problem x^x=1*10^100, solve for x. 56^56=7.916*10^97, 57^57=1.215*10^100. Your bounds are 56 and 57, and your answer is somewhere in between.

    So take half the difference between your lower and upper bounds, 0.5, and add it to your lower bound. 56.5^56.5=9.789*10^98. Not enough, so 56.5 is now your lower bound.

    So take half the difference between your lower and upper bounds, 0.25, and add it to your lower bound. 56.75^56.75=3.448*10^99. Not enough, so 56.75 is now your lower bound.

    Keep doing this. If your x^x is larger than your target, then x becomes your upper bound instead of your lower bound. Repeat until you have sufficient accuracy in your x.

    Fred
    Hey, you! "It's" with an apostrophe means "it is" or "it has." "Its" without an apostrophe means "belongs to it."

    "For shame, gentlemen, pack your evidence a little better against another time."
    -- John Dryden, "The Vindication of The Duke of Guise" 1684

    Earth's sole legacy will be a very slight increase (0.01%) of the solar metallicity.

  7. #7
    Join Date
    Mar 2010
    Location
    United Kingdom
    Posts
    6,989
    https://xlinux.nist.gov/dads/HTML/squareRoot.html

    This method is not trial and error but does get a bit unwieldy after a few iterations.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •