[ 3 / a / adv / an / asp / cgl / ck / co / diy / fa / g / gd / int / jp / k / lit / m / mlp / mu / n / o / out / p / po / sci / sp / tg / toy / trv / tv / v / vg / vp / vr / w / wsg / x]

/sci/ - Science & Math

<< back to board
[Delete this thread]

Anonymous 06/28/14(Sat)17:42 UTC+1 No.6616455 Report

> 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.
>>
Anonymous 06/28/14(Sat)17:48 UTC+1 No.6616465 Report

>>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
>>
Anonymous 06/28/14(Sat)17:48 UTC+1 No.6616466 Report

>>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
>>
Anonymous 06/28/14(Sat)17:48 UTC+1 No.6616467 Report

>>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.
>>
Anonymous 06/28/14(Sat)17:49 UTC+1 No.6616468 Report

Tell them that you can't represent infinity this way, as it's a limit, not a number or a constant.
>>
Anonymous 06/28/14(Sat)17:53 UTC+1 No.6616476 Report

>>6616455
Just go with your partners' idea. A+ for creativity and giving a finger to the math police.
>>
Anonymous 06/28/14(Sat)17:58 UTC+1 No.6616480 Report

>>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.
>>
Anonymous 06/28/14(Sat)17:59 UTC+1 No.6616482 Report

>>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.
>>
Anonymous 06/28/14(Sat)18:07 UTC+1 No.6616499 Report

>>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;
}
>>
Anonymous 06/28/14(Sat)22:00 UTC+1 No.6616832 Report

>>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.
>>
Anonymous 06/28/14(Sat)22:26 UTC+1 No.6616906 Report

>>6616455
f(x)=1/x is a holomorphic map to the Riemann sphere with 1/x=f(0)=\infinity.
>>
Anonymous 06/28/14(Sat)22:39 UTC+1 No.6616928 Report

>>6616906
complex infinity, not infinity
>>
Anonymous 06/28/14(Sat)22:41 UTC+1 No.6616930 Report

>>6616928
It's the same infinity, the "complex" infinity is just the limit of all lines.
>>
Anonymous 06/28/14(Sat)22:41 UTC+1 No.6616932 Report

>>6616465
wow thanks i just achieved satori
>>
Anonymous 06/29/14(Sun)02:49 UTC+1 No.6617280 Report

>>6616465
capitalisation is objectively useless. the only reason to use it is to not look like a complete redneck among formal and unfamiliar audiences.
>>
Anonymous 06/29/14(Sun)02:55 UTC+1 No.6617286 Report

>>6616455
IEEE-754 gives you that for free.
>>
Anonymous 06/29/14(Sun)02:56 UTC+1 No.6617289 Report

>>6616499
you forgot to check for -0 and invert
>>
Anonymous 06/29/14(Sun)03:00 UTC+1 No.6617293 Report

In asm you would get NaN (not a number) I think maybe its inf but pretty sure it'd be a NaN
>>
Anonymous 06/29/14(Sun)03:08 UTC+1 No.6617305 Report

>>6616455
Become a fascist, you'll never need to explain again.
>>
Anonymous 06/29/14(Sun)03:09 UTC+1 No.6617310 Report

[code]
$ nodejs
> 1/0
Infinity
> 1/-0
-Infinity
> 0/0
NaN
[/code]
>>
Anonymous 06/29/14(Sun)03:19 UTC+1 No.6617317 Report

>>6616455
not that stupid
>>
Anonymous 06/29/14(Sun)03:24 UTC+1 No.6617319 Report

>>6616482
>Hey guise im so smart cause -1*-1 = i XD
>>
Anonymous 06/29/14(Sun)03:33 UTC+1 No.6617327 Report

>>6616466
>2. there is no number which, multiplied by 0, gives 1
Then why don't we just invent one, like the number i
>>
Anonymous 06/29/14(Sun)03:36 UTC+1 No.6617328 Report

>>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
>>
Anonymous 06/29/14(Sun)03:45 UTC+1 No.6617338 Report

>>6616465
>pronouns are not words
i don't even know anymore
>>
Anonymous 06/29/14(Sun)03:46 UTC+1 No.6617339 Report

>>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.
>>
Anonymous 06/29/14(Sun)05:31 UTC+1 No.6617440 Report

>>6617319
>-1*-1 = i XD
are you retarded?
>>
Anonymous 06/29/14(Sun)07:18 UTC+1 No.6617606 Report

>>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.
>>
Anonymous 06/29/14(Sun)07:24 UTC+1 No.6617620 Report

>>6616499
better version:

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

or

if( top == bottom )
return 1;
>>
Anonymous 06/29/14(Sun)07:26 UTC+1 No.6617625 Report

>>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.
>>
Anonymous 06/29/14(Sun)07:30 UTC+1 No.6617629 Report

>>6617625
Found it, I was sort of right, https://www.youtube.com/watch?v=BRRolKTlF6Q
>>
Anonymous 06/29/14(Sun)07:32 UTC+1 No.6617631 Report

>>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.
>>
Anonymous 06/29/14(Sun)07:33 UTC+1 No.6617634 Report

>>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."
>>
Anonymous 06/29/14(Sun)08:10 UTC+1 No.6617667 Report

>>6617440
He's a CS major
>>
Anonymous 06/29/14(Sun)08:27 UTC+1 No.6617672 Report

>>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
>>
Anonymous 06/29/14(Sun)08:53 UTC+1 No.6617689 Report

>>6616455
*tips fedora*
>>
Anonymous 06/29/14(Sun)09:01 UTC+1 No.6617692 Report

> 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.
>>
Anonymous 06/29/14(Sun)09:04 UTC+1 No.6617695 Report

>>6616466
>there is no number which, multiplied by 0, gives 1
you're forgetting !
>>
Anonymous 06/29/14(Sun)09:23 UTC+1 No.6617711 Report

>>6617310
-infinity and infinity is the same thing. Viewed in that light, the graph of 1/x is nice and continuous.
>>
Anonymous 06/29/14(Sun)09:33 UTC+1 No.6617715 Report

>>6617280
Capitalization makes text easier to read.
>>
Anonymous 06/29/14(Sun)09:36 UTC+1 No.6617717 Report

>>6616499
>double
>==
>>
Anonymous 06/29/14(Sun)09:36 UTC+1 No.6617718 Report

>>6617689
Top cancer
>>
Anonymous 06/29/14(Sun)09:37 UTC+1 No.6617719 Report

>>6616499
There is no need for that. double aritchmetics already includes those checks.
>>
Anonymous 06/29/14(Sun)09:42 UTC+1 No.6617723 Report

numberphile did a video on this explaining it well.
>>
Anonymous 06/29/14(Sun)10:23 UTC+1 No.6617752 Report

>>6617695
exhaled sharply/10
>>
Anonymous 06/29/14(Sun)10:24 UTC+1 No.6617754 Report

>>6617752
what does that even mean? how is BREATHING going to disprove me?
>>
Anonymous 06/29/14(Sun)10:27 UTC+1 No.6617759 Report

>>6617754
exhale sharply, right now
what did that sound like?
>>
Anonymous 06/29/14(Sun)10:39 UTC+1 No.6617770 Report

>these are the people who go on to work at Facebook and Google
no wonder modern web design is so fucking terrible
>>
Anonymous 06/29/14(Sun)10:40 UTC+1 No.6617771 Report

>>6617759
like hhhihhhh
>>
Anonymous 06/29/14(Sun)10:46 UTC+1 No.6617773 Report

it's all fun and games, until they go into industry and become someones managers.
>>
Anonymous 06/29/14(Sun)20:48 UTC+1 No.6618428 Report

>>6617672
Nope.
You can't do that algebraic manipulation.
>>
Anonymous 06/29/14(Sun)21:19 UTC+1 No.6618475 Report

>>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.
>>
Anonymous 06/29/14(Sun)21:56 UTC+1 No.6618526 Report

>>6617771
>hhhihhhh
>hhhehhhh
>heh
>a common reaction to something funny
>>
Anonymous 06/29/14(Sun)21:59 UTC+1 No.6618530 Report

>>6617711
you must be an American, or a troll.
>>
Anonymous 06/29/14(Sun)22:01 UTC+1 No.6618536 Report

>>6618428
But theses guys probably don't know that, so it doesn’t matter.
>>
Anonymous 06/29/14(Sun)22:07 UTC+1 No.6618551 Report

>>6616455
Division by zero will net a complex infinity.
>You sir are the potato.
>>
Anonymous 06/29/14(Sun)22:08 UTC+1 No.6618554 Report

>>6618530
Projective spaces are not exclusive to american mathematics and are a serious non-troll concept.
>>
Anonymous 06/29/14(Sun)22:10 UTC+1 No.6618558 Report

>>6618551
Complex infinity is an infinite number in the complex plane whose complex argument is unknown or undefined.-Who is the potato now?
>>
Anonymous 06/29/14(Sun)22:45 UTC+1 No.6618605 Report

>>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.
>>
Anonymous 06/29/14(Sun)22:48 UTC+1 No.6618610 Report

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

</thread>
>>
Anonymous 06/29/14(Sun)22:51 UTC+1 No.6618617 Report

>>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?
>>
Anonymous 06/29/14(Sun)23:00 UTC+1 No.6618630 Report

Look up the "extended real number system"
>>
Anonymous 06/29/14(Sun)23:27 UTC+1 No.6618661 Report

>>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!
>>
Anonymous 06/29/14(Sun)23:28 UTC+1 No.6618664 Report

>>6618661
Laughing at someone that has more math skill then you, sad.
>>
Anonymous 06/29/14(Sun)23:33 UTC+1 No.6618673 Report

>>6618664
>more math skill
>calc 1
HAHAHAHAHAHAHAHAHAHAHAHAHAHA
>>
Anonymous 06/29/14(Sun)23:37 UTC+1 No.6618685 Report

>>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.
>>
Anonymous 06/29/14(Sun)23:39 UTC+1 No.6618688 Report

>>6618673
Cyber-tuff-dewd probably thinks ? is still considered irrational.
>>
Anonymous 06/29/14(Sun)23:54 UTC+1 No.6618700 Report

>>6618688
>>
Anonymous 06/30/14(Mon)00:05 UTC+1 No.6618706 Report

>>6617327
There's no one saying you can't, but there's no use for it. Unlike imaginary arithmetic, which is extremely useful
>>
Anonymous 06/30/14(Mon)00:26 UTC+1 No.6618727 Report

>>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???
>>
Anonymous 06/30/14(Mon)00:30 UTC+1 No.6618732 Report

>>6617711
There are many ways to compactify the reals, of which the projective line is but one.
In the extended real line, we have +\infty and -\infty.
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 2^{\mathfrak{c}} infinities.
>>6618617
You shouldn't be so hostile. He doesn't know about projective geometry, but you insisted - without qualification - that +\infty = -\infty, which is patently untrue.
>>
Anonymous 06/30/14(Mon)00:35 UTC+1 No.6618738 Report

>>6618727
>if binary is important then why do we use decimals in other areas of math
All the content on this website comes from 4chan.org. 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. 4chanArchive is not affiliated with 4chan.