Fun
Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

This is why I hate having dyscalculia.

Pi is an irrational number, which means it can’t be expressed as a simple fraction. Therefore, pi has an infinite number of decimal places, but it can be approximated as 22/7, or 3.141.

Who the fvck thinks of numbers as irrational vs rational, are they irrational because the numbers are mad and they're being irrational or what? Then since they're angry, they're a simple fraction (whatever that means) and this irrational behavior leads Pi to suddenly spawning an infinite number of decimal places which make out to be exactly 22 slash 7.

This is how read math concepts as a dyscalculic person.

💁‍♀️

https://realpython.com/python-math-module/
This page is a permanent link to the reply below and its nested replies. See all post replies »
I prefer 355/113 as an approx. of pi.

Why worry about rational numbers? There are good reasons when you are doing long extensive calculations.

If you are writing software that attempts to maintain exact values, then it's very useful to store numbers as lowest terms fractions.

Why would you care about exact values in software? Well, it's like this. Most computers can only compute rapidly with so-called double precision floating point numbers. These are accurate to 16 decimal places (52 bit mantissa), far more than enough accuracy for almost any engineering or scientific calculation.

BUT! when you start chaining calculations together, the last bit can err randomly either high or low. It would be nice if these last-bit errors canceled out, but what they do is a random walk in one bit steps from the true value.

The expected distance of a random walk is the square root of the number of steps. So after 10^10 = 10 billion chained calculations, you can expect to be 10^5 = 100,000 last bit steps from the true value. Your 16 bit accuracy has just dropped to 11 bits. And how long does it take to do 10 billion chained double precision calculations? As little as 3 seconds (with 3Ghz clock; half the time if "fused multiply add" ops are used).

One million seconds is 12 days. So a four day run (not unusual for some calculations) can do 10^16 chained calculations, and the last bit random walk loses you 8 of your original 16 digits of accuracy.

It can get worse, because most big computations are calculating thousands or millions of numbers in parallel. So the worst case random walk can be several times worse than the expected random walk. And some calculations that are not "well conditioned" can magnify the errors far more.

There are ways to estimate whether a calculation is "well conditioned" and for those cases your code might want to use rational number and/or pay the price for simulating higher precision in software.
SatanBurger · 36-40, F
@ElwoodBlues I just don't get why their labeled as rational or irrational. How can a number be irrational?
SatanBurger · 36-40, F
@ElwoodBlues Here's the definition:

irrational
ĭ-răsh′ə-nəl
adjective
Not endowed with reason.
Affected by loss of usual or normal mental clarity; incoherent, as from shock.
Marked by a lack of accord with reason or sound judgment.
MethDozer · M
@SatanBurger They just need to have a name. The term basically stems from it being kinda difficult to wrap one's head around a constent or value that has an infinate decimal. You can never fully express the value to perfection in a calculation.
SatanBurger · 36-40, F
@MethDozer Okay that makes sense kind of to me which is better than before.

But wanted to ask that if it's that irrational then what makes "pi" even legit? If it can't be rationally explained, I don't know why it's even a legit concept.
MethDozer · M
@SatanBurger basically because it works and it's a value in ratios that can be obsevered. Now, here's where you might be avle to visualize it. You know how there is no such thing as a perfect circle? That's why. The ratio is based on an irrational number that has an infinate decimal. It van never he perfected because the value it is based on can never be completely expressed. The value cannot be perfectly expressed because a circle can never be perfect. Welcome to the wonderful proximate world of Euclidean geometry
@SatanBurger Yes, as methdozer said, 'rational' numbers (like 1/7) can be exactly expressed as a ratio, even though they might be an infinitely long repeating decimal (1/7=0.142857142857142857142857...)

Meanwhile, to add to the confusion, mere irrationals can be expressed as the roots of a (finitely long) algebraic expression such as the roots of a quadratic equation.

And trancendental numbers such as pi and e (these appear in trig and log calculations) can only be expressed as the converging sum of an infinite series.
SatanBurger · 36-40, F
@ElwoodBlues Yeah I really wanted to learn python but not sure now, I'm taking a free class so that's decent but then I learned about all that math and stuff. I'm dyscalculic which means that I can learn concepts but they're harder for me, might as well be learning Arabic.
MethDozer · M
@ElwoodBlues It's worth noting too that rational numbers are actually a rarity in the natural world.
MethDozer · M
@SatanBurger Python and other scripting languages aren't that difficult really, not nearly as much as true coding languages can be. The thing is for anyone there is a huge learning curve. Scripting ans coding are one of those things that doesn't make any sense at all for a long time in the begining but at a certain point the ball really starts rolling. There's an aha moment that sorta comes out of the blue with it. Often when you are one is on verge of going bonkers just rrying to form a simple grasp.
@SatanBurger In Python, you really won't have to worry at all about these fancy kinds of numbers. And most of your attention will probably be on text strings and if-then-else type statements.

You'll only face two kinds of numbers - "integers" and "floating point." Integers are just that, positive or negative whole numbers; useful when counting the number of characters in a text string or iterations thru a software loop. "Floating point" numbers have digits after the decimal point and possibly an exponent. That part won't be bad at all.

Python is a great first language to learn.

P.S. the kinds of calculations I was describing were for things like calculating where all the planets & moons in the solar system would be in a million years and how they would be perturbed if a jupiter sized object came zooming thru the solar system. Or how the hood of a car might buckle in a range of near head-on collision scenarios.
MethDozer · M
☝️this @ElwoodBlues
SatanBurger · 36-40, F
@ElwoodBlues @MethDozer Well that makes me feel a bit better, I just get intimidated at first glance because it sounds confusing when looking ahead at the modules. I got a course that is apparently 200 designed experiments in python to allow me to learn but looking at it I don't understand anything terminology wise and other things. I plan on still learning though... python is kind of the gateway language for a lot of other things and if I can learn it, I feel confident going into other programming concepts.
@SatanBurger The terminology sounds intimidating at first, but there isn't really that much of it, and google can be your friend. You can type "explain difference between function and subroutine" or "explain local variables in python" or whatever.

Another useful thing to know about coding at least for most of us, is that it's a process of managing frustration. It really is. You write a program, try to run it, and it throws some syntax errors. So you fix your typos, and it's still throwing errors. Or maybe it runs but doesn't behave properly. And you realize you have some "think-os" - conceptual errors. Those are the frustrating ones.

And you have to stick with it, re-think parts of your code, print out certain intermediate info to see if it's behaving like you expect. And you have to know when you're spinning your wheels and you should turn your mind away from it for a while. In college, many of my bugs I finally solved by quitting for the night and walking back to my dorm. And with my mind off the problem, suddenly I'd see my mistake.

Managing frustration. We all make lots of programming mistakes, especially in the early days, and they're hard to identify. It can help to be part of a community; to have fellow students to bounce your bugs off of, or a mentor you can turn to in extremis. If there's even 1 other person you can convince to take your course at the same time it can be a big help. I've seen online resources like forums where people can ask for help, but I don't know how good they are.
@SatanBurger

Here's the definition:

irrational
ĭ-răsh′ə-nəl
adjective
Not endowed with reason.
Affected by loss of usual or normal mental clarity; incoherent, as from shock.
Marked by a lack of accord with reason or sound judgment.

You gave *a* definition, not the technical definition in mathematics.

Numbers which can be represented as a ratio (p/q, with p & q both integers) are "rational". Those which cannot be so represented are "not rational" = "irrational".

Any normal integer can be represented as itself over 1:

3 = 3/1 (rational), 7 = 7/1, etc.

Non-repeating decimals are rational:

1.75 = 175/100 = 7/4 (rational)

Even repeating decimals:
_
0.3 = 1/3 (rational)

π is irrational; it is NOT 22/7 OR ANY ratio of two integers. Those are approximations.