Announcement

Collapse
No announcement yet.

Post whacky or neat math stuff

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    "If one-and-a-half chickens lay one-and-a-half eggs in one-and-a-half days, how many eggs lay nine chickens in nine days?"

    (That's actually pretty easy if you calculate it, but if you ask some random person to answer straight away, you hear either 9 or 81, but very rarely the true solution)

    Comment


    • #47
      Originally posted by Sir Ralph
      IIRC that's a good approximation. I made an exact solution (no graphics, no iterations) with 6 digits in the 80's and wrote it down in a notebook, which I hope I can find when I'm at home. If memory serves right, it starts with 1.231...

      How did you find it, graphical?
      W = width of well
      H2 = height at which the 2m stick rests upon the wall
      X2 = distance from the wall that 2m stick emerges from water

      1) Create formulae for the height at which the two sticks rest on the wall e.g. H2^2 + W^2 = 2^2
      2) Create formulaE for the gradient at which the two sticks rest. E.g. G2 = H2/W
      3) Create formulae for the value of X. e.g X2 = 1/G2
      4) X2 + X3 = W.
      5) Solve simultaneous equations
      One day Canada will rule the world, and then we'll all be sorry.

      Comment


      • #48
        Originally posted by Sir Ralph
        An oldie but goodie...

        There's a cylindrical well with some amount of water in it. 2 sticks stand in it, reaching from the bottom at one side to the wall on the other and crossing themselves exactly at the surface of the water. One stick is 3 meters tall (or any other unit), the other 2 meters. The water stands 1 meter high. What's the diameter of the well?
        This is equivalent to solving a quartic equation.
        12-17-10 Mohamed Bouazizi NEVER FORGET
        Stadtluft Macht Frei
        Killing it is the new killing it
        Ultima Ratio Regum

        Comment


        • #49
          Originally posted by KrazyHorse
          This is equivalent to solving a quartic equation.
          Yes.

          Comment


          • #50
            54

            Comment


            • #51
              42 is the answer to everything.
              Blah

              Comment


              • #52
                Using double precision, I can get the answer to 1.231185724 or so.
                12-17-10 Mohamed Bouazizi NEVER FORGET
                Stadtluft Macht Frei
                Killing it is the new killing it
                Ultima Ratio Regum

                Comment


                • #53
                  Sounds right .

                  I solved it with 6 digits in the 80's, but had only a 8-digit pocket calculator. Precision is secondary, by the way, it always can be increased. But most people I met aren't even able to get the problem into an equation.

                  Comment


                  • #54
                    Since it's just a quartic with well-separated roots, it's fairly well-behaved numerically. The quartic I had was in terms of h2, the vertical displacement between the top and bottom of the shorter stick.

                    The equation is monotonically increasing in the range h2 = [1.093,inf) or so, so most root finding algorithms will do a very good job of pinning it down very quickly. I wrote the dumbest root finding routine ever to solve it (took about 15 seconds to write) and it only evaluated the function 23 times before reaching the limits of double precision. A smarter method (newton-raphson etc) would probably have done it in 6 or 7 function evaluations.
                    12-17-10 Mohamed Bouazizi NEVER FORGET
                    Stadtluft Macht Frei
                    Killing it is the new killing it
                    Ultima Ratio Regum

                    Comment


                    • #55
                      2 + 2 = 5. granted, this only works for specific values of two, but i digress.
                      I wasn't born with enough middle fingers.
                      [Brandon Roderick? You mean Brock's Toadie?][Hanged from Yggdrasil]

                      Comment


                      • #56
                        For more calculator fun, you can always multiple 37037037037 by multiples of 3, or 12345679 by multiples of 9.

                        Hours of fun for the whole family.

                        Comment


                        • #57
                          Originally posted by KrazyHorse
                          Since it's just a quartic with well-separated roots, it's fairly well-behaved numerically. The quartic I had was in terms of h2, the vertical displacement between the top and bottom of the shorter stick.

                          The equation is monotonically increasing in the range h2 = [1.093,inf) or so, so most root finding algorithms will do a very good job of pinning it down very quickly. I wrote the dumbest root finding routine ever to solve it (took about 15 seconds to write) and it only evaluated the function 23 times before reaching the limits of double precision. A smarter method (newton-raphson etc) would probably have done it in 6 or 7 function evaluations.
                          As mentioned, I didn't have the luxury of a computer and calculating iterations with a pocket calculator with only 1 memory cell made me shudder. Hence, I had to solve it the hard way, i.e. by reducing it to a cubic and finally solving this. Took me about half an hour, but it was fun.

                          Comment


                          • #58
                            Originally posted by KrazyHorse
                            The equation is monotonically increasing in the range h2 = [1.093,inf) or so, so most root finding algorithms will do a very good job of pinning it down very quickly. I wrote the dumbest root finding routine ever to solve it (took about 15 seconds to write) and it only evaluated the function 23 times before reaching the limits of double precision. A smarter method (newton-raphson etc) would probably have done it in 6 or 7 function evaluations.
                            Why reinvent the wheel? Most numerical libraries should have some root-finding function built in (or if it doesn't, presumably you've had to write one for your work at some point).

                            Comment


                            • #59
                              Originally posted by Kuciwalker


                              Why reinvent the wheel? Most numerical libraries should have some root-finding function built in (or if it doesn't, presumably you've had to write one for your work at some point).
                              Because I don't have the numerical recipes library locally on my laptop, and writing the root finder took less time than sshing onto the departmental network, editing a file via terminal emacs and remembering the proper linking syntax.
                              12-17-10 Mohamed Bouazizi NEVER FORGET
                              Stadtluft Macht Frei
                              Killing it is the new killing it
                              Ultima Ratio Regum

                              Comment


                              • #60
                                Code:
                                      DO 101 I = 0, 100
                                        GUESS = (TOP+BOT)/2.0
                                        RES = AFUNKP(GUESS)
                                        IF(RES.LT.0.0) BOT=GUESS
                                        IF(RES.GE.0.0) TOP=GUESS
                                        PRINT *, GUESS, RES, BOT, TOP
                                 101  CONTINUE
                                12-17-10 Mohamed Bouazizi NEVER FORGET
                                Stadtluft Macht Frei
                                Killing it is the new killing it
                                Ultima Ratio Regum

                                Comment

                                Working...
                                X