Author |
Topic: Rounded Roots (Read 372 times) |
|
Sir Col
Uberpuzzler
impudens simia et macrologus profundus fabulae
Gender:
Posts: 1825
|
|
Rounded Roots
« on: Jun 28th, 2003, 3:16am » |
Quote Modify
|
A special number machine will accept any natural number, find its square root and then output the result rounded to the nearest whole number. For example, 32 — square root —> 5.656... — rounded —> 6 1. If 6 is the output, what is the set of possible input numbers? 2. For a given output, n, find the set of possible input numbers. 3. Prove your result.
|
|
IP Logged |
mathschallenge.net / projecteuler.net
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Rounded Roots
« Reply #1 on: Jun 28th, 2003, 8:32am » |
Quote Modify
|
1> Inputs={x|31<=x<=42} 2> Inputs={x|((n-1)2+k)<=x<=(n2+k)} where k = floor((4n-3)/4)+1 3> note that all such number will be greater than (n-1)2 our inputs will be simply determined by an offset from (n-1)2.Take this offset as k, Then it is easy to note that, sqrt((n-1)2+k)>(n+(n-1))/2 solving this for k gives the answer.
|
« Last Edit: Jun 28th, 2003, 8:33am by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
Sir Col
Uberpuzzler
impudens simia et macrologus profundus fabulae
Gender:
Posts: 1825
|
|
Re: Rounded Roots
« Reply #2 on: Jun 28th, 2003, 9:36am » |
Quote Modify
|
Nice solution, TenaliRaman. What a clever and original approach too. Having done the hardest part, you might like to simplify it, as you don't need the floor function. Consider: sqr((n–1)2+k)>=n–0.5
|
« Last Edit: Jun 28th, 2003, 9:41am by Sir Col » |
IP Logged |
mathschallenge.net / projecteuler.net
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Rounded Roots
« Reply #3 on: Jun 28th, 2003, 10:04am » |
Quote Modify
|
D'oh!! ofcourse !!! k = floor((4n-3)/4)+1 = floor(n-3/4)+1 = n - 1 + 1 = n P.S-> yes ofcourse my avatar.(should've noticed that!!) This P.S should've been in the other topic
|
« Last Edit: Jun 28th, 2003, 10:07am by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
Sir Col
Uberpuzzler
impudens simia et macrologus profundus fabulae
Gender:
Posts: 1825
|
|
Re: Rounded Roots
« Reply #4 on: Jun 28th, 2003, 10:12am » |
Quote Modify
|
What if the number machine cube roots? (I've not solved this myself yet) P.S. Oh well, it'll add a bit of intrigue (and confusion) for anyone who's not read the other topic – especially as they don't know what the other topic or the question was.
|
|
IP Logged |
mathschallenge.net / projecteuler.net
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Rounded Roots
« Reply #5 on: Jun 28th, 2003, 10:54am » |
Quote Modify
|
i followed the same approach as above for the cube root which gives, k = floor( (12n2-18n+7)/8 )+1 Simplification of this though seems difficult.
|
|
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
|