|
|
|
 |

September 21st, 2004, 10:20 PM
|
 |
Major General
|
|
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
Narf: I don't know of any cut and dry equation for finding a square root - however, there is a reasonably simple recursive method for approximating a square root to any precision desired:
R(0, N) = N
R(k, N)) = (N/R(k - 1, N) + R(k - 1, N))/2
DO NOT DO THIS RECURSIVLY - run it as a loop, saving the Last value.
Where N is the original number (constant), and k is a method to control the precision.
A sample: N = 16
Root(0, 16) = 16;
Root(1, 16) = (16/16 + 16)/2 = (1 + 16) / 2 = 8.5
Root(2, 16) = 5.1911764...
Root(3, 16) = 4.1366647...
Root(4, 16) = 4.0022575...
Root(5, 16) = 4.0000006...
Root(6, 16) = 4.0000000...
As you can see, it gets there farily quickly.
__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
|

September 21st, 2004, 10:23 PM
|
 |
Lieutenant General
|
|
Join Date: Nov 2002
Posts: 2,903
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
If you're allowed to use logarithms:
sqrt (x) = e^(0.5 * ln(x))
|

September 21st, 2004, 10:58 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Interesting math problem...
Thanks Jack. But, still not an equation.
Kamog, what?
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|

September 22nd, 2004, 08:37 PM
|
 |
Major General
|
|
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
Quote:
Kamog said:
If you're allowed to use logarithms:
sqrt (x) = e^(0.5 * ln(x))
|
Kamog, I don't mean to be picky, but if you have decimal exponents available to do the e^ portion, you don't need logarithms at all:
sqrt (x) = x^(0.5)
- it's a basic identity.
__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
|

September 23rd, 2004, 01:46 AM
|
 |
Lieutenant General
|
|
Join Date: Nov 2002
Posts: 2,903
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
Quote:
Jack Simth said:
Kamog, I don't mean to be picky, but if you have decimal exponents available to do the e^ portion, you don't need logarithms at all:
sqrt (x) = x^(0.5)
- it's a basic identity.
|
Hmm, that's a good point.
Yeah, I know that identity. Actually I started off with it to get the equation:
y = x^0.5
ln(y) = ln(x^0.5)
ln(y) = 0.5*ln(x)
y = e^(0.5*ln(x))
I see what you mean, why use logarithms if you have decimal exponents available.
|

September 23rd, 2004, 01:55 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Interesting math problem...
So, how do you calculate 64^0.5 without a calculator?
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|

September 23rd, 2004, 02:12 AM
|
 |
Lieutenant General
|
|
Join Date: Nov 2002
Posts: 2,903
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
Here's a trick to calculate square roots of square numbers without a calculator. Keep subtracting odd numbers like this:
1. 64 - 1 = 63
2. 63 - 3 = 60
3. 60 - 5 = 55
4. 55 - 7 = 48
5. 48- 9 = 39
6. 39 - 11 = 28
7. 28 - 13 = 15
8. 15 - 15 = 0
It took 8 steps to get to 0 so the square root of 64 is 8. I don't know why this works.
|

September 23rd, 2004, 02:25 AM
|
 |
Major General
|
|
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Interesting math problem...
Narf: Mostly using an iteritive Version of the function I posted earlier; although it does have issues if you feed it 0 or a negative number. There is no cut and dry one line, one pass equation to get a square root using the basic four functions (*/+-)
Kamog: that method works based on geometry. First, consider a 1x1 square of selected numerals:
Code:
1
Notice that there is one 1. In order to expand the square to a 2x2 grid, you need to add in 3 places: one above (or below) the existing 1, one left (or right) of the one, and another to fill in the corner three of them:
Code:
33
13
Suppose that we want to expand it further to a 3x3; we need to add two above (or below), two to the left (or right) and one in the corner 5 of them:
Code:
555
335
135
To generalize this, to get a square of size (N+1)x(N+1) from a square of size NxN, you need to add 2*N + 1 squares. (note that this works from a 0x0 - 2*0 + 1 = 1). In subtracting progressivly greater odd numbers, you are reversing the process - first you take out one square:
Code:
555
335
35
Then you take out three squares:
Code:
555
5
5
Then you take out five squares:
Code:
Once you are all out of squares, you are done.
However, those squares could also represent numbers just as easily.
__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|