To add comments or start new threads please go to the full version of: Square Root
PhysOrgForum Science, Physics and Technology Discussion Forums > General Sci-Tech Discussions > Homework Help

DavidD
I propose algorithm how to take square root and want to know do exist some shorter way to take square root. Analog computer can take square root only with about 3-5 decimal digits precision.
Here is my algorithm for square root of 2 (2^0.5=1.414213562)
0^2<2; 1^2<2; 2^2=4>2; 1.0^2<2; 1.1^2=1.21<2; 1.2^2=1.44<2; 1.3^2=1.69<2; 1.4^2=1.96<2; 1.5^2=2.25>2; 1.40^2<2; 1.41^2=1.9881<2; 1.42^2=2.0164>2; 1.410^2<2; 1.411^2=1990921<2; 1.412^2=1993744<2; 1.413^2=1.996569<2; 1.414^2=1.999396<2; 1.415^2=2.002225>2; 1.4140^2<2; 1.4141^2<2; 1.4142^2<2; 1.4143^2>2; 1.41420^2<2 and so on. I take square root without scientific calculator with 5 digits precision, this can't made the best analog computer. Quantum computer is also analog computer in nature, so need very carefully to think about limitations of quantum computer... tongue.gif

I a little bit to think and invent even faster algorithm for square root taking. For example 17^0.5=4.123105626. With my algorithm:
10^2=100>17; 5^2=25>17; 2^2=4<17; 3^2=9<17; 4^2=16<17; 4.5^2=20.25>17; 4.2^2=17.64>17; 4.1^2=16.8<17; 4.15^2=17.2225>17; 4.12^2=16.9744<17; 4.13^2=17.0569>17; 4.125^2>17; 4.122^2<17; 4.123^2<17; 4.124^2>17; 4.1235^2>17; 4.1232^2>17; 4.1231^2<17; 4.12315^2>17; 4.12312^2>17; 4.12311^2>17; 4.123105^2=16.99999484<17; 4.123107^2=17.00001133>17; 4.123106^2>17; 4.1231055^2=16.99999896<17; 4.1231057^2=17.00000061>17; 4.1231056^2=16.99999979<17; 4.12310565^2=17.0000002>17; 4.12310562^2=16.99999995<17; 4.12310563^2=17.00000004>17; 4.123105625^2=16.99999999<17; 4.123105627^2=17.00000001>17; 4.123105626^2=17 biggrin.gif
For analog computer it's obviously imposible. Prety simple task even for me, but imposible for analog computer and for quantum... cool.gif
mr_homm
Here is a nicer algorithm for square roots:

To get sqrt(x):

Step 1: Guess G = 1.
Step 2: New Guess = (G + x/G)/2
Repeat step two as much as you want to get an accurate answer.

For example, sqrt(2)
G = 1
G = (1+2/1)/2 = 3/2 = 1.5
G = (3/2 + 4/3)/2 = 17/12 = 1.4166666667
G = (17/12 + 24/17)/2 = 577/408 = 1.414215686
G = (577/408 + 816/577)/2 = 665857/470832 = 1.414213562

By the 4th guess, the square is 2.000006007, and by the fifth it is
2.000000000, so this goes much faster then yours. It gets 10 digits
of accuracy in just 4 calculations.

You are correct that this is not the sort thing an analog computer
can do. Analog computers get reasonably accurate answers very fast
by using a physical system to simulate the calculation.

Fortunately, quantum computers are not designed this way. They
are not analog computers, they are digital computers with superposition.
The difference is that the quantum states represent LOGIC values,
not numerical magnitudes. In fact, that's the definition of
digital as opposed to analog.

The main challenge with quantum computers is that the quantum states
representing the data "decohere" after a short time. In order to
delay this, they usually operate at very cold temperatures, where
there is less heat to disturb the system. Even so, the states
decohere quickly. The data from the state must be read quickly
enough, before it decays. That is difficult but not impossible,
and when it is done, you have a computer which is capable of
the unlimited precision of a digital computer, along with the
inherent parallel processing capacity (via superposition) which
characterizes analog computers. It is a "best of both worlds"
computer.

Hope that helps!

--Stuart Anderson
DavidD
Amazing.

Analog computers unable to take square root of 2 with more than 5 decimals precision (better than G = (17/12 + 24/17)/2 = 577/408 = 1.414215686), becouse the accuracy is 10^{-4}. They don't have more than 1000-100000 "digital" levels.
When they for example solving diferential equation then coeficients arn't bigger than 0.236, 0.589.

http://www.cisl.columbia.edu/grads/gcowan/vlsianalog.pdf
"Accuracy: Analog computers are not very accurate. Solutions are usually
accurate to no better than 0.1 % - 1 %. These errors stem from the following:
˛ Thermal, flicker and shot noise.
˛ Nonlinear transfer characteristics of blocks that should be linear.
˛ Other deviations from the intended input-to-output transfer characteristics of
memoryless blocks. For example: imperfect multiplication of multipliers, finite
output resistance of current mode circuits, or o®sets of variable gain amplifiers.

˛ Finite DC gain of integrators.
˛ Input offsets of integrators.
˛ Finite bandwidth of memoryless blocks and non-dominant poles in the integra-
tors.
˛ Granularity in the setting of coe±cients such as integrator time constants or
gains of variable gain amplifiers.
˛ Coupling between signal wires."

Only most 5 decimal digits can manage analog computer:
"6.2.2 First Order Nonlinear SDEs: Particle in a Potential
Well
Mathematical Description: The diferential equation investigated here is an ex-
ample of an Ornstein-Uhlenbeck process and is given by:
x' = -gradU(x) + n(t) (6.26)
grad denotes the gradient operation. For this example, x is a scalar and U(x) =
0.185x^4 + 0.0139x^3 - 0.251x^2
giving gradU(x) = 0.740x^3 + 0.0416x^2 - 0.502x. The
function n(t) is a random variable with zero mean and a Gaussian distribution.
Physical Interpretation and Qualitative Behaviour: U(x) is referred to
as a potential function. This system describes a particle moving in a double potential
well. x is the horizontal displacement of the particle, while gradU(x) is the steepness of
the well. For this example, the cubic gradient has roots at: -0.852, 0.796 and 0. The
first and second root give rise to stable equilibria. This means that in the absence of
large noise, if the particle is near one of these roots, it will stay near one of them, and
if the noise were reduced to zero, the particle would converge to one of these values of
x. The root at zero is an unstable equilibrium, and hence, infinitesimally small noise
will perturb the particle away from it. This is analogous to an inverted pendulum.
Mathematically, the inverted vertical state is a solution, but the smallest noise will
disturb the pendulum from its balance."

5 digits is 100000 levels, so thats why analog computer can't manage with more than 5 digits, becouse nature don't leting it, becouse nature itself is noisy...

Quantum computer qubit indeed is analog, becouse qubit can be rotatated with arbitrary degree, but qubit rotation precision is limited with 0.99999, becouse qubit rotation is analog. So after 100000 qubit rotations, qubit will loose all information and will obey like random bit (if will be measured). With more qubits rotation precision also decreasing, becouse qubits then rotates also each over and so 1000 qubits quantum computer will break down after 100 rotations of each qubit.
Qubits are rotated from one binary state to another binary state, but this rotations still is analog and not binary/digital.
If entanglement between atoms or electrons realy was estimated, then possible that 2 or more qubits quantum computer isn't faster and don't giving speedup, becouse number of qubits rotations is far more than 10000.
But what if qubits also rotating another atoms or electrons - the noise?..
AlphaNumeric
QUOTE (DavidD+Mar 25 2008, 11:17 AM)
Analog computers unable to take square root of 2 with more than 5 decimals precision (better than G = (17/12 + 24/17)/2 = 577/408 = 1.414215686), becouse the accuracy is 10^{-4}. They don't have more than 1000-100000 "digital" levels.
When they for example solving diferential equation then coeficients arn't bigger than 0.236, 0.589.

This is complete nonsense! I've solved integrals to hundreds of decimal places. Done differential equations using 12 decimal places for my coefficents.

Just write your own C code if you don't believe me. Use it to apply Mr Homm's algorithm (which is by no means the fastest but is very simple) and you'll get more than 100 decimal places easily.

Mathematica doesn't even need you to do programming, it uses a much more straight forward language.

You're, once again, denying things which are already in existence! Do you really think that a current computer cannot give a square root to more than 5 decimal places?! Hand calculators can do better than that! If it takes someone with a pencil and paper only 60 seconds to do the 10 calculations needed to work out a square root to 10 decimapl places, why would a calculator not be able to do them? Working out square roots is easy

You can download programs which 'stress test' your computer by working out Pi to a billion decimal places. Accurately. Part of my PhD involves looking at the variation in the 12th decimal place of results from differential equations I've numerically integrated.

Rather than browsing Google and copying and pasting things you don't understand learn some maths and physics.
DavidD
You absolutly IDiOT I was talking about ANALOG computer.
Moomin
QUOTE (DavidD+Mar 30 2008, 11:00 AM)
You absolutly IDiOT I was talking about ANALOG computer.

laugh.gif laugh.gif laugh.gif ..... you anal-log.
DavidD
QUOTE (Moomin+Mar 30 2008, 11:26 AM)
laugh.gif laugh.gif laugh.gif ..... you anal-log.

You and alphanumeric
Enthalpy
Did you notice the 21st century is here? Analog computers are hard to find now.

One existing iterative algorithm is a bit faster than the arithmetic mean value, as it has none of the divisions that slow computers down. It's a Newton-Raphson by some means.
DavidD
QUOTE
Did you notice the 21st century is here? Analog computers are hard to find now.

Ofcourse I notice, do you think I am so stupid?
QUOTE (->
QUOTE
Did you notice the 21st century is here? Analog computers are hard to find now.

Ofcourse I notice, do you think I am so stupid?
One existing iterative algorithm is a bit faster than the arithmetic mean value, as it has none of the divisions that slow computers down. It's a Newton-Raphson by some means.

you mean this algorithm http://www.sosmath.com/calculus/diff/der07/der07.html laugh.gif it is the same algorithm which give mr_homm.
DavidD
But analog computer still used in places where speed is more important than precision...
"The VMS uses an analog computer with the control loader because computing speed is critical in real-time simulation of flight controls."
http://www.simlabs.arc.nasa.gov/vms/computers.html
Enthalpy
Forget analog computers. And forget their "speed", it's false.
Nasa probably has some antiques at many places. In 1991, I saw computers with ferrite memory at Ariane. They just hadn't changed the computer for 15 years.

No, I didn't write you're so stupid. I wrote the algorithm has no division, as opposed to the one described by Mr_Homm.
DavidD
If analog computer is antiquar, when why there is this paper about modern analog computers in some certine tasks http://www.cisl.columbia.edu/grads/gcowan/vlsianalog.pdf ?
Enthalpy
Because so many teachers are outdated, quite simply.
PhysOrg scientific forums are totally dedicated to science, physics, and technology. Besides topical forums such as nanotechnology, quantum physics, silicon and III-V technology, applied physics, materials, space and others, you can also join our news and publications discussions. We also provide an off-topic forum category. If you need specific help on a scientific problem or have a question related to physics or technology, visit the PhysOrg Forums. Here you’ll find experts from various fields online every day.
To quit out of "lo-fi" mode and return to the regular forums, please click here.