[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 6 KB, 394x236, infinityjh.gif [View same] [iqdb] [saucenao] [google]
6616455 No.6616455 [Reply] [Original]

> in programming class at college
>working with the dumbest two potatoes in the class.
>need to create command line calculator, basic arithmetic, logs, trig functions etc.
>they think its so genius and cool if they make it so that when you divide by zero it gives infinity
>i tell them that that's not really mathematically correct, we should just return "undefined" or "error", but they won't have any of it.

please tell me how to explain well to them how stupid this idea is.

>> No.6616465
File: 112 KB, 612x792, BE IMPORTANT.jpg [View same] [iqdb] [saucenao] [google]
6616465

>>6616455
>>i tell them that that's not really mathematically correct, we should just return "undefined" or "error", but they won't have any of it.
>i

retard detected

>> No.6616466

>>6616455
>veiled 1/0 troll thread
Bit I'll bite

1. infinity is not a number

2. there is no number which, multiplied by 0, gives 1

>> No.6616467

>>6616455
Computers perform mathematical operations in specific and sometimes surprising ways with the rules depending on the underlying hardware , language and specific implementation. This is particularly true of C and to a lesser extent C++, with 'undefined behaviour' everywhere.

>> No.6616468

Tell them that you can't represent infinity this way, as it's a limit, not a number or a constant.

>> No.6616476

>>6616455
Just go with your partners' idea. A+ for creativity and giving a finger to the math police.

>> No.6616480

>>6616468
More specifically computers can't directly represent infinity as such, since ultimately their concept of numbers is just a sequence of 0's and 1's however many bits wide. The way infinity is handled is hardware specific, floating point especially is a complex area.

>> No.6616482

>>6616455
>>i tell them that that's not really mathematically correct, we should just return "undefined" or "error", but they won't have any of it.

Stop trying to be a smart ass. By virtue of being a CS major, you're clearly retarded.

>> No.6616499

>>6616455

double division(double top, double bottom){
if( (top==0 && bottom==0) || std::isnan(top) || std::isnan(bottom) )
return std::numeric_limits<double>::quiet_NaN();
if( bottom==0 )
if(top>0)
return std::numeric_limits<double>::infinity();
else
return -std::numeric_limits<double>::infinity();

return top/bottom;
}

>> No.6616832

>>6616482
>By virtue of being a CS major, you're clearly retarded.

How do you know he's CS? If it's a "programming class" it's one of those super introductory shit classes all majors have to take.

>> No.6616906

>>6616455
f(x)=1/x is a holomorphic map to the Riemann sphere with 1/x=f(0)=\infinity.

>> No.6616928

>>6616906
complex infinity, not infinity

>> No.6616930

>>6616928
It's the same infinity, the "complex" infinity is just the limit of all lines.

>> No.6616932

>>6616465
wow thanks i just achieved satori

>> No.6617280

>>6616465
capitalisation is objectively useless. the only reason to use it is to not look like a complete redneck among formal and unfamiliar audiences.

>> No.6617286

>>6616455
IEEE-754 gives you that for free.

>> No.6617289

>>6616499
you forgot to check for -0 and invert

>> No.6617293

In asm you would get NaN (not a number) I think maybe its inf but pretty sure it'd be a NaN

>> No.6617305

>>6616455
Become a fascist, you'll never need to explain again.

>> No.6617310


$ nodejs
> 1/0
Infinity
> 1/-0
-Infinity
> 0/0
NaN

>> No.6617317
File: 884 B, 94x167, inf.png [View same] [iqdb] [saucenao] [google]
6617317

>>6616455
not that stupid

>> No.6617319

>>6616482
>Hey guise im so smart cause -1*-1 = i XD

>> No.6617327

>>6616466
>2. there is no number which, multiplied by 0, gives 1
Then why don't we just invent one, like the number i

>> No.6617328

>>6616466
This is why a convincing argument isn't enough
> infinity is not a REAL or COMPLEX number nor a QUATERNION
> there exists no number in a field such that when multiplied by 0 gives 1

>> No.6617338

>>6616465
>pronouns are not words
i don't even know anymore

>> No.6617339

>>6617327
You can try and see if you get anything meaningful out of it but considering you didn't already realize that you are not good enough at maths to do it.

>> No.6617440

>>6617319
>-1*-1 = i XD
are you retarded?

>> No.6617606
File: 154 KB, 500x496, ThatsMathHandSoap.jpg [View same] [iqdb] [saucenao] [google]
6617606

>>6616455
Should 0/0 be infinity?

For every n not equal to 0, n/n = 1. As n goes to 0, we see that 0/0 should be 1.

For every n not equal to 0, n^2/n = n. As n goes to 0, we see that 0/0 should be 0.

If x is any real or complex number, x*n/n = x. As n goes to 0, we see 0/0 = x.

So I think that clearly demonstrates 0/0 is quite problematic in itself. What about x/0? Well, x/0 = (x*n) / (0 * n) = (x*n) / 0. As n goes to zero, we see that x/0 = 0/0. So any definition of x/0 must be ill-defined since we have demonstrated it can be argued to be any complex number or infinity. Thus the reason it should return undefined is because it can't really be properly defined.

>> No.6617620

>>6616499
better version:

if( top == 0 && bottom == 0 )
return 1;

or

if( top == bottom )
return 1;

>> No.6617625

>>6617606
I remember Numberphile had a video on this where they compared it to the origin on a coordinate plane and how it changes depending on the line going through it.

>> No.6617629

>>6617625
Found it, I was sort of right, https://www.youtube.com/watch?v=BRRolKTlF6Q

>> No.6617631

>>6617625
Yes. You can easily turn what I said into a geometrical picture in the plane. The symbol infinity as you would see in calculus is only used in the context of limits. Infinity essentially means "arbitrarily large". It can't really be manipulated algebraically or arithmetically in any meaningful way.

>> No.6617634

>>6616455
"We're making a fucking calculator. A fucking. Calculator. You put in math equations and it gives you answers. You want to intentionally make the calculator output an incorrect answer."

>> No.6617667
File: 125 KB, 948x543, CS student, 5 years later.png [View same] [iqdb] [saucenao] [google]
6617667

>>6617440
He's a CS major

>> No.6617672

>>6616455

Show them this:
If you decide to consider infinity as a number and state that x/0=infinity then see what happens:

consider x!=y

x/0=infinity > x=infinity * 0
y/0=infinity > y=infinity * 0
> x=y

>> No.6617689

>>6616455
*tips fedora*

>> No.6617692

> in programming class at college
>working with the dumbest potatoe in the class.
>need to create command line calculator, basic arithmetic, logs, trig functions etc.
>friend and I think its so genius and cool if they make it so that when you divide by zero it gives infinity
>potatoe tell us that that's not really mathematically correct, we should just return "undefined" or "error", but they won't have any of it.

please tell me how to explain well to them how genius this idea is.

>> No.6617695

>>6616466
>there is no number which, multiplied by 0, gives 1
you're forgetting !

>> No.6617711

>>6617310
-infinity and infinity is the same thing. Viewed in that light, the graph of 1/x is nice and continuous.

>> No.6617715

>>6617280
Capitalization makes text easier to read.

>> No.6617717
File: 64 KB, 533x800, wtf_is_this_bullshit.jpg [View same] [iqdb] [saucenao] [google]
6617717

>>6616499
>double
>==

>> No.6617718

>>6617689
Top cancer

>> No.6617719

>>6616499
There is no need for that. double aritchmetics already includes those checks.

>> No.6617723

numberphile did a video on this explaining it well.

>> No.6617752

>>6617695
exhaled sharply/10

>> No.6617754

>>6617752
what does that even mean? how is BREATHING going to disprove me?

>> No.6617759

>>6617754
exhale sharply, right now
what did that sound like?

>> No.6617770

>these are the people who go on to work at Facebook and Google
no wonder modern web design is so fucking terrible

>> No.6617771

>>6617759
like hhhihhhh

>> No.6617773

it's all fun and games, until they go into industry and become someones managers.

>> No.6618428

>>6617672
Nope.
You can't do that algebraic manipulation.

>> No.6618475

>>6617717
x = 5 sets the variable x equal to the value 5 then returns true if it doesn't fail
x == 5 returns true if x is already equal to five

double is like float, but has more memory allocated to it.

>> No.6618526

>>6617771
>hhhihhhh
>hhhehhhh
>heh
>a common reaction to something funny

>> No.6618530

>>6617711
you must be an American, or a troll.

>> No.6618536

>>6618428
But theses guys probably don't know that, so it doesn’t matter.

>> No.6618551
File: 267 KB, 766x864, arya.jpg [View same] [iqdb] [saucenao] [google]
6618551

>>6616455
Division by zero will net a complex infinity.
>You sir are the potato.

>> No.6618554

>>6618530
Projective spaces are not exclusive to american mathematics and are a serious non-troll concept.

>> No.6618558
File: 143 KB, 900x597, Potato.jpg [View same] [iqdb] [saucenao] [google]
6618558

>>6618551
Complex infinity is an infinite number in the complex plane whose complex argument is unknown or undefined.-Who is the potato now?

>> No.6618605

>>6618554
consider the function f(x) = x.
are you trying to tell me that the limit of f(x) as x approaches -infinity is infinity? Because my calc I class says that you are full of shit.

>> No.6618610

>>6616455
They joined the CS program to make vidya gaemz.

</thread>

>> No.6618617

>>6618605
Your calc 1 class didn't tell you about projective spaces. So why don't you shut your uneducated retard face when adults are talking about math?

>> No.6618630

Look up the "extended real number system"

>> No.6618661

>>6618605
>he's seriously using his calc 1 class as if it was something to gloat about
>calc 1
Look at him!

Look at him and laugh!

>> No.6618664

>>6618661
Laughing at someone that has more math skill then you, sad.

>> No.6618673

>>6618664
>more math skill
>calc 1
HAHAHAHAHAHAHAHAHAHAHAHAHAHA

>> No.6618685

>>6616455
If you are using C/C++/C#/Java/Python, floats/doubles, and a modern computer/compiler, then x/0 will give you some infinity representation, if x is not 0. If x is 0, then you will get a Not-A-Number representation. (VB may throw an exception.)

This is behavior is defined in IEEE-754. Some people far smarter than you decided that this was the best default behavior. In time, some people at your intellectual level made it the only behavior.

>> No.6618688

>>6618673
Cyber-tuff-dewd probably thinks π is still considered irrational.

>> No.6618700
File: 916 KB, 245x285, qHBf6.gif [View same] [iqdb] [saucenao] [google]
6618700

>>6618688

>> No.6618706

>>6617327
There's no one saying you can't, but there's no use for it. Unlike imaginary arithmetic, which is extremely useful

>> No.6618727

>>6618617
serious question: if projective spaces are a thing, and if they are important, then why even make the distinction of positive and negative infinity in other areas of maths???

>> No.6618732

>>6617711
There are many ways to compactify the reals, of which the projective line is but one.
In the extended real line, we have <span class="math">+\infty[/spoiler] and <span class="math"> -\infty[/spoiler].
In the Stone-Cech compactification of the reals, there are as many additional points as there are subsets of the real line. As the Stone-Cech compactification is the most general compactification (all others factor through it), it could be argued that the real line has <span class="math">2^{\mathfrak{c}}[/spoiler] infinities.
>>6618617
You shouldn't be so hostile. He doesn't know about projective geometry, but you insisted - without qualification - that <span class="math">+\infty = -\infty[/spoiler], which is patently untrue.

>> No.6618738

>>6618727
>if binary is important then why do we use decimals in other areas of math