| Imagine you are trying to explain this to a 15 year old. If math is going to make sense to kids we can't resort to explanations that sound like "and then a miracle occurs". BTW, I am not being critical of your answer. What I am saying is that there are these corners in seemingly simple math that have me scratching my head when it comes to explaining the concepts to a kid in a manner that makes sense and isn't circular. I have yet to find good answers to these questions. Kid: What does the 10th. root of n mean? Dad: It's the number, let's call it x, that, when raise to the 10th power is equal to n Kid: So: n = x * x * x * x * x * x * x * x * x * x? Dad: Yes! You got it! Kid: How do you calculate it? Dad: Well... Kid: What if it is the 10.1 root of n? Dad: Well, that's a little different... Kid: How? Dad: It's the number than when raised to the p-1 power times the base raised to the fractional portion of the power is equal to n Kid: What's the fractional portion? Dad: For the case of p = 10.1, it's 0.1 Kid: x * x * x * x * x * x * x * x * x * x^(p - int(p)) then? Dad: Yeah. Kid: How do I calculate x to the 0.1 power? Dad: Well, you could use your calculator...(now starting to sweat) Kid: How does the calculator do the math. You know, like when the math teacher says "Show your work" Dad: Well, you could use logarithms... Kid: What are logarithms? Dad: A better method could be to use Newton's method. Here: https://en.wikipedia.org/wiki/Newton%27s_method Kid: It says: "start with an initial guess which is reasonably close to the true root, then to approximate the function by its tangent line using calculus, and finally to compute the x-intercept of this tangent line by elementary algebra" Dad: Yes... Kid: I don't know calculus. Is that the only way? I just wanted to understand how to calculate the 10th root of a number? Dad: OK, let's try this. I just threw it together: # Calculate the exp root of n using a binary search
#
def root_binary_search(n, exp):
# Return b, which is the exp root of n
# b**exp should be equal to n
#
min = 0
# For exponents < 1 the max needs to be sufficiently large
max = n
if exp < 1:
while max**exp < n:
max *= 2
max_error = 0.00001
while True:
b = (max + min) / 2
b_exp = b**exp
error = abs(n - b_exp)
# print(f"min: {min:15.4f} max: {max:15.4f} b: {b:15.4f} b_exp: {b_exp:15.4f} n: {n:15.4f} error: {error:5.8f}")
if error <= max_error:
return b
else:
if b_exp > n:
max = b
else:
min = b
# Tests
print(root_binary_search(4, 2), f" result should be: {4**(1/2)}")
print(root_binary_search(16, 2), f" result should be: {16**(1/2)}")
print(root_binary_search(5, 0.1), f" result should be: {5**(1/0.1)}")
print(root_binary_search(2, 10), f" result should be: {2**(1/10)}")
print(root_binary_search(4, 0.25), f" result should be: {4**(1/0.25)}")
Kid: So...you are telling me to guess?Dad: Yeah...? (looking embarrassed) Kid: And to accept an error? 4-squared is 256, not 255.998046875? Dad: Well, you have to understand that with a binary search... Kid: And, did you see what happens if I run this case? print(root_binary_search(4, 1), f" result should be: {4**1}")
Kid: Dad?Dad: I have to get back to work. Why don't you ask your math teacher tomorrow? |
I'm not questioning the pedagogy in the original comment, just the specific math. x^(1/10) takes a value of dimension [length^10] to a value of dimension [length].
Interestingly, I think you could take this in a few aesthetic directions. From a pure math perspective, this is where you can start talking about set theory, cardinality, etc. Irrational numbers are infinite sequences of digits we can only approximate. From a computer science perspective, you can talk about Newton's method, and also make the argument than an algorithm which converges to a number is a quite meaningful way to describe that number. Some would also add a caveat of 'efficiently' converging. And combining the two perspectives together, you can discuss that the set of computable numbers are of a lower cardinality than the set of reals -- aka 0% of real numbers are computable. You could also look at things from a geometrical perspective, and show how roots higher than square roots are tied to higher dimensions are are nonconstructible in the plane (this might be very hard to show!).