With that attitude how do you handle e.g. pi or sqrt(2), which it's perfectly legitimate to do arithmetic with?
With that attitude how do you handle e.g. pi or sqrt(2), which it's perfectly legitimate to do arithmetic with?
However, with numbers that have non-repeating inifinite decimal expansions, it is completely imposible to do arithmetic in the decimal notation. I'm not exagerating: it's literally physically impossible to represent on paper the result of doing 3pi in decimal notation in an unambiguous form other than 3pi. It's also completely impossible to use the decimal expansion of pi to compute that pi / pi = 1.
Here, I'll show you what it would be like to try:
pi / pi
= 3.141592653589793238462643383279502884197169399375105820949445923078164062862089986280348253421170679821480865132820664709384460955058223172....
Now, of course you can do arithmetic with certain approximations of pi. For example, I can do this: pi / pi
≈ 3.1415 / 3.1415
= 1
Or even 3 × pi
≈ 3 × 3
= 9
But this is not doing arithmetic with the decimal expansion of pi, this is doing arithmetic with rational numbers that are close enoigh to pi for some purpose (that has to be defined). say pi/pi; #1say (pi/pi).^name; # Num
import math
result = math.pi / math.pi
print(result) #1.0
bit more long winded than raku, but nearly rightfwiw I want my pi/pi to be 1 (ie an Int) not 1.0 but then I’m a purist
Note that writing sqrt(2) as 1.41 or 1.41421 or any other decimal expansion you might want to write is incorrect: you will always get some roundoff error. If you want to calculate that sqrt(2)*sqrt(2)=2 then you can’t do so by multiplying the decimal expansions.
Sure if a question asks for the escape velocity from Jupiter this has an approximate numerical value, but you don't just start by throwing numbers at a wall, you get the simplest equation which represents the value you're interested in an then evaluate it once you have a single equation for that parameter.
Yes sqrt(2)*pi has a numerical approximation but you don't want that right at the start of taking about something like spin orbitals or momenta of spinning disks. Doing the latter compounds errors.
It's no different to keeping around "i"/"j" until you need to express a phase or angle as it's cleaner and avoids compounding accuracy errors.
3.1415<pi<3.1416 and 1.4142<sqrt(2)<1.4143, => 4.5557<pi + sqrt(2)<4.5559
=> 4.553 < 4.5557 < pi + sqrt(2) => 4.553 < pi + sqrt(2)When you're doing something like pi + sqrt(2) ≈ 3.14159 + 1.41421 = 4.5558, you're taking known good approximations of these two real numbers and adding them up. The heavy lifting was done over thousands of years to produce these good approximations. It's not the arithmetic on the decimal representations that's doing the heavyh lifting, it's the algorithms needed to produce these good approximations in the first place that are the magic here.
And it would be just as easy to compute this if I told you that pi ≈ 314159/100000, and sqrt(2) ≈ 141421/100000, so that their sum is 455580/100000, which is clearly larger than 4553/1000.
I'm curious if they had a better one that we don't know of yet—their best known approximation of sqrt(2) is significantly more accurate.
What? The opposite is the case. Anything you want to do something with, you can only measure inaccurately; arithmetic doesn't have any use if you can't apply it to inaccurate measurements. That's what we use it for!
Catastrophic cancellation and other failures are serious issues to consider when doing numerical analysis and can often be avoided completely by using symbolic calculation instead. You can easily end up with wrong results, especially when composing calculations. This would make it difficult to, for example, match your theoretical model against actual measurement results; particularly if the model includes expressions that don't have closed-form solutions.
I prefer comparing it to complex numbers where I can't have "i" apples but I can calculate the phase difference between 2 power supplies in a circuit using such notation.
Nobody really cares about the 3rd decimal place when taking about a speeding car at a turn but they do when talking about electrons in an accelerator, so accuracy and precision always feel mucky to talk about when dealing with irrationals (again my opinion).
Except we have some fascination with memorizing the digits of pi and having competitions for doing so for some reason.
The fascination is just dick measuring. "I'm smarter than you", for memorizing a longer string? It's quite dumb, but American media loves to use the dumbest possible ways of demonstrating that a character is intelligent, because uh it's really really hard to demonstrate "This person is very intelligent" to a subset of the population that is mostly at a middle school reading level and barely comprehends basic arithmetic, let alone algebra.
Agreed. The schools always seem to have these learning adjacent things that are theoretically supposed to make subjects engaging, but in reality are so disconnected from the subject that they are meaningless.