[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Weird stuff calculators seem to do

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 1

File: Capture.png (18KB, 575x325px) Image search: [Google]
Capture.png
18KB, 575x325px
I found today that my calculator gives the wrong answer, and all of the calculators I can find give different answers, when given the following sum:
[math](10+4\sqrt{6})^2-20(10+4\sqrt{6})+4 [/math]
It should be zero, right, I'm not just retarded?Can anybody explain? Why does this happen? Pls no bully
>>
>>8681374
https://en.wikipedia.org/wiki/Floating_point
>>
>>8681374
>using a calculator
>>
>>8681384
youre using one right now
>>
>>8681375
So essentially irrationals are approximated? But then why does
[math] (10 + 4\sqrt{6})^2-20(10 + 4\sqrt{6}) [/math] just give -4?
>>
>>8681374
Google chromes "adress bar calculator" gives different values for the gamma-function than WolframAlpha.
>>
>>8681391
it can go wrong, but it can also go right
>>
>>8681390
you are an idiot
>>
>>8681407
cant admit to his faults
>>
>>8681391
Because (-4)-(5.6843419e^-14) doesn't fit on a calculator screen.
>>
>>8681391
>irrationals are approximated
Yes, also any repeating decimal or "sufficiently precise" number is approximating.

For example, the decimal representation of 1/3 is 0.3333... so an infinite number of 3s is required. A computer obviously can't store infinite 3s, so it has to eventually approximate.
>>
>>8681374
My cassio calculator gives the right result.
MATLAB also gives the right answer if you calculate it with symbolic variables.

The problem is that a computer can not store arbitrary floating point numbers, as it would require infinite memory.

But it can also calculate via symbolic variables, where sqrt(6) is not represented as a floating point number but as a different data structure where e.g. sqrt(6)^2 is exactly 6 not just an aproximation.

I would suggest that if you really want accurate results you should use something like matlab or octave.

I am actually surprised how lazy google is with these things.
>>
>>8681439
Google is also fucking ass for being a reliable calculator.

>Working on an assignment, using Google for simple arithmetic if it shows up instead of bothering to open up Wolfram Alpha.
>Recursive formula shows up
>Enter sum of 5 terms in Google
>result is given
>Enter sum of 6 terms in Google
>result is given
>Enter sum of 7 terms in Google
>Google gives up and simply searches the input instead of calculating it.
>>
>>8681374
They use floats, so it's a rounding error.
All calculators and all computers are broken in this way. Calculators are based on an imperfect mathematical notation system in base 10 represented--badly--in base 2. Study this for a while and you'll see how ridiculous calculators are.

Calculators use different cpu and support chips and have different precision; if not externally, then internally where you can't see it.

Try working with money and you'll soon see that fractions can add up to dollars and discrepancies.
>>
It is possible for a computer to evaluate this symbolically and return exactly 0
>>
Had to use the windows calculator today. It was full of surprises.
>>
>>8683369
Yes, this is what wolframalpha does. It is actually not that difficult to do in principle, all it requires is in the semantics of the input language, to define algebraic rules, e.g. (a+b)(c+d) = ac + ad + bc + bd, and so on, then recursively call the evaluation on each part of the expression.

So for the expression in OP, say we had a function, eval :: Expr -> Expr, then define addition, subtraction, multiplication and division on the type "Expr", then call expr:

expr(a + b) = expr(a) + expr(b)
expr(a b) = expr(a) expr(b)

and so on, semantically, "Expr" could look as another anon said in this thread, as a sort of data-structure (most likely a Tree) that keeps these values in algebraic format
Thread posts: 17
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.