Author Topic: Division by Zero  (Read 15321 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Division by Zero
« Reply #15 on: November 13, 2021, 05:12:39 am »
@STxAxTIC

Lim(x->0) (n^x - 1) / x

As any number to the power 0 is 1, I assumed that the answer is always 0 (it is if n=1).  As you imagine that 'raising to the power' goes 'more quickly' than division, I assumed that the numerator get closer to zero than does the divisor.  But spreadsheet shows this not to be the case.

  [ You are not allowed to view this attachment ]  

Thinking cap required.


« Last Edit: November 13, 2021, 08:02:25 am by Qwerkey »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Division by Zero
« Reply #16 on: November 13, 2021, 06:58:13 am »
Division by zero is undefined.  You simply can't do it.  It's impossible to take *something* and divide it up to the point that *nothing* remains.  Vice versa, it's also impossible to take an infinite number of *nothings* and have them turn into a number of *somethings*.

What STx keeps forgetting to mention is he's talking about THE LIMIT of his equations.  For practical purposes, we can say SIN(0) / 0 = 1, but that's the same as SINGLE presion math -- it's just rounding after a certain number of arbitrary digits (infinity, in this case).  I understand the concept -- as a farmer, I've used it all my life.  "It's 3.2 miles from my house to the spring box where I get my water."  And, it is..  Give or take a few miles depending on how much you get lost and meander around in the forest and mountains getting there.  It's close enough for practical purposes, but it's not the mathematical answer of 3.1786437231475 miles, which is what GPS data gives as a mathematical response. 

Practically, sin(0) / 0 = 1.

Mathematically, *anything*divided by zero is *undefined*. 
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Division by Zero
« Reply #17 on: November 13, 2021, 08:14:16 am »
@STxAxTIC

I note that log(10) = 2.302585.  So by inspection my answer is

log(n)

(For any critical reader, we are, of course, talking natural logs).

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Division by Zero
« Reply #18 on: November 13, 2021, 09:27:45 am »
Say, excellent analysis Qwerkey! The answer is indeed the natural log of n. That's a pretty keen eye you must have in order to just pluck that pattern out of a sea of numbers.

And I knew Steve would eventually take his shot. Homie, me and you been having this argument for the better part of a decade, on one forum or another, one thread or another, mostly calculated by me, admittedly. I try to "sneak" notions of calculus into.... just everything, all the time... and there you are, on each thread, reminding me that you still personally need to catch up to the 16th century in terms of mathematical reasoning. I forgive the Greeks for tripping themselves up in Zeno's paradox, not understanding concepts like convergence, etc., but that was thousands of years ago. Now... there's no possible way that you would take this lesson publicly, and only on a cold day in hell would you take this lesson publicly *from me*... so I'll leave that right there. Last word is yours if you want it but you gotta understand I needed to respond to what you said publicly and why its so important that you read a book on precalculus and retain what's in there!

Last time: I shouldn't even need to say this a second time because the proof is already in this thread, but sin(0)/0 is exactly 1, not approximately, not in the limit, but exact. The mechanic of this goes far deeper than booting up qb64.exe and trying PRINT Sin(0) / 0 to verify your bias. To claim this is all somehow the same a single precision math is ... just what? Don't confuse the tool with the wood itself.

You're not done when it works, you're done when it's right.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Division by Zero
« Reply #19 on: November 13, 2021, 09:50:47 am »
Moving on, regardless...

Qwerkey - for academic completeness, here is how I know its the natural log:
  [ You are not allowed to view this attachment ]  

Say, want another? This one is less about division by zero and closer to *multiplication* by zero, ooooh boy. Anyway, the formula is:
  [ You are not allowed to view this attachment ]  

So what you do is pick a number N, set up a loop that calculates all those square roots (with N total square roots taken). Then, multiply that result by 2^N and you might be shocked by the final answer.
« Last Edit: November 13, 2021, 01:16:11 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Division by Zero
« Reply #20 on: November 13, 2021, 11:35:34 am »
Last time: I shouldn't even need to say this a second time because the proof is already in this thread, but sin(0)/0 is exactly 1, not approximately, not in the limit, but exact. The mechanic of this goes far deeper than booting up qb64.exe and trying PRINT Sin(0) / 0 to verify your bias. To claim this is all somehow the same a single precision math is ... just what? Don't confuse the tool with the wood itself.

Okay, let's follow this irrefutable logic...

sin(0) / 0 = 1

Now, everyone knows that sin(0) = 0, so what you're *really* saying is that 0/0 = 1.

Now the following has to also be true, if we multiply both sides by 2:

2 * (sin(0)) / 0) = 2 * (1)
(2 * sin(0)) /( 2 * 0) = 2
2 * sin(0) / 0 = 2

Which sounds logical, until we realize that once again, sin(0) = 0, so what we have here is now:

2 * 0 / 0 = 2
0 / 0 = 2

But Stx just told us that sin(0) / 0 = 1!   He irrefutably argued that 0 / 0 = 1!  And yet, 0/0 is now both 1 and 2?!!  (And any other number that we want to repeat this process with...)

sin(0) = 0, so the heart of his argument is that 0 / 0 = 1... But, we just proved that it was equal to 2??  GASP!!



And when it comes to the heart of the matter, WHAT IS DIVISION?  Nothing but glorified subtraction, just as multiplication is glorified addition.

3 * 5 is the same as saying (add 3 to itself 5 times)...  3 * 5 = 3 + 3 + 3 + 3 + 3.   Total is 15.

15 divided by 3 is the same as saying (how many times can I take 3 away from 15, before I hit 0?)...  15 / 3 =  15 - 3 - 3 - 3 - 3 - 3.   Count those 3's and you end up with 5.  15 / 3 = 5.

Now, the problem comes when we ask about any number divided by 0.

How many times can you take nothing away from something, before reaching 0?

3 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 .... an infinite number of times, but we still have 3...

BUT, STx likes to argue that if you have nothing, you can take nothing from it exactly once, and still have nothing!!  0 - 0 = 0...   The problem here is that you can *also* do this for infinity.  0 - (0 - 0 - 0) = 0.  Well, I just subtracted 0 three times there and got 0 for the end result, so the answer has to be THREE!  0 / 0 = 3!!

You just can't do it.   Division by zero is undefined -- just as much in the 61st century as it ever was back in the 16th.

https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Division by Zero
« Reply #21 on: November 13, 2021, 11:58:59 am »
And for Qwerky, who likes charts, let's build one:

sin(x)/ x = ???   (The chart before seemed to indicate that it equaled 1.)

Let's simply multiply both sides by two...   What is (2 * sin(x)) / (2 * x)??

Code: QB64: [Select]
  1. For x = 20 To 1 Step -1
  2.     y = x / 100
  3.     Print y, Sin(y) / y, (2 * Sin(y)) / (2 * y)

  [ You are not allowed to view this attachment ]  

Just as before, our answer approaches 1...

So, (2 * sin(0)) / (2 * 0) = 1, according to the chart and the limit above.

Factor that 2 back out and we get:  2 (sin(0) / 0) = 1

And OBVIOUSLY, as STx has assured us above, (sin(0) / 0) = 1, so let's substitute that value in there.

2 * 1 = 1

And now we have irrefutable proof that 2 = 1!

Sounds about right to me.  :P
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Division by Zero
« Reply #22 on: November 13, 2021, 12:02:39 pm »
For a mathematician, Lim(x->0) sin(x)/x is definitely 1, so Bill is right, of course.

sin(x)/x is a 'special case' (?), as sin(x) -> x for small x (and increasingly accurate as x -> 0): the sin function is 1:1 linear near the origin.  So the condition becomes 0/0 which is undefined, so Steve is right, of course.

Numbers!  What a mystery the universe is.

How do mathematicians ever get to sleep with all that stuff going on?

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Division by Zero
« Reply #23 on: November 13, 2021, 12:14:36 pm »
Bless your heart Qwerkey, trying to divide the cake evenly at the end. Unfortunately this issue is not a matter of democracy, or seeing things both ways, or honoring the length of one's filibuster post. (Could you say it shorter next time Steve? haha) There is really just one right approach to this:

For those still following, remember the definition of sinc = sin x / x in the first place. Looky here:

  [ You are not allowed to view this attachment ]  

The factor of "1/x" completely cancels out of the equation. I circled it for y'all. That is, I wish I could do that *clap* emoji... The *clap* sinc function *clap* contains *clap* no *clap* singular *clap* points!!!! Division by zero never occurs, at all.
You're not done when it works, you're done when it's right.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Division by Zero
« Reply #24 on: November 13, 2021, 12:19:37 pm »
For a mathematician, Lim(x->0) sin(x)/x is definitely 1, so Bill is right, of course.

sin(x)/x is a 'special case' (?), as sin(x) -> x for small x (and increasingly accurate as x -> 0): the sin function is 1:1 linear near the origin.  So the condition becomes 0/0 which is undefined, so Steve is right, of course.

Numbers!  What a mystery the universe is.

How do mathematicians ever get to sleep with all that stuff going on?

The LIMIT is 1, but it's never actually one.  It'll get infinitely close to 1, but never quite achieve that point.  For *practical* purposes, you can often say it's one.  For pure mathematical definition, it's indefinite/undefined, and for the reason I showed you above.

Ask Siri sometime what 0 dived by zero is.  She'll set the issue straight.


https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Division by Zero
« Reply #25 on: November 13, 2021, 12:51:23 pm »
Bless your heart Qwerkey, trying to divide the cake evenly

Oh well, I tried.

Looks like it'll come to blows.  Two pugilists in the ring, 15 rounds.  Possibly shorter if one of the combatants ends up flat out on the canvass.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Division by Zero
« Reply #26 on: November 13, 2021, 01:10:32 pm »
Naaaah, I assured Steve he had the last word on the actual topic on hand (as far as he and i go), but I did break protocol once and repeat myself: my posts after that have been salvaging the public face of of this now-cringeworthy thread. I hope that nobody searching google for "qb64 division by zero" pulls up THIS thread, ya feel? Let's hope this just goes away and the take-away is you now know a cool formula for the natural log, can't deny that!

EDIT: BTW, There is still one more open puzzle on this page ^. Give that a stab (and see if we can't trigger steve all over again for breaking the rules in a new way)
« Last Edit: November 13, 2021, 01:52:20 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Division by Zero
« Reply #27 on: November 13, 2021, 01:41:12 pm »
In formula sin(x) / x because sin() function is for angles. x has to be assumed an angle and angle 0 is equivalent to 2I*pi, I being some Integer.

So as I said before, pay attention to the thing you are dividing by because pure numbers don't have to take that into account.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Division by Zero
« Reply #28 on: November 13, 2021, 01:58:19 pm »
Interesting thought bplus, the trig functions do some nice work with angles, but it is not an axiomatic requirement that the argument in sin() be an angle. The argument can be any real number, any complex number - even an entire matrix, believe it or not - all inside the argument of sin(). (And no, putting sin() around a matrix does not simply mean you compute the sine of each component, that would be too easy, haha.)

The whole reason I brought up sin(x)/x in the first place is because it has a removeable singularity, which means it has no singularity. Honestly, between me and everyone, at this point I feel like nothing more than a troll for evoking the monty python-esque rebuttals to calculus that I knew were gonna come.
You're not done when it works, you're done when it's right.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Division by Zero
« Reply #29 on: November 13, 2021, 03:08:21 pm »
EDIT: BTW, There is still one more open puzzle on this page ^.

Will try & have a go tomorrow.