Author Topic: [JAVA] Calculate Pi!  (Read 19247 times)

0 Members and 1 Guest are viewing this topic.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [JAVA] Calculate Pi!
« Reply #60 on: November 16, 2005, 08:51:28 pm »
So they're both infinite, but one has twice as many values? :)

And by the way, you are absolutely right:
There are varying levels of infinity. Numerically, as in counting from 1, 2 ,3, 4 etc, they are infinity, but cardinally, as in {1, 2, 3, ...}, integers are greater. I believe they are alaph numbers..

[Edit]: Whoops, Aleph* Numbers
Rational, whole, natural, etc., are all "countable" infinite sets.  So is Real, apparently, but we haven't proven that one yet. 

It's still neat to think that there are the same "number" of even numbers as even+odd numbers. 

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [JAVA] Calculate Pi!
« Reply #61 on: November 16, 2005, 09:05:53 pm »
Not reach infinite, be infinite.  :o

Actually, if either could reach infinity, neither would be faster.

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [JAVA] Calculate Pi!
« Reply #62 on: November 16, 2005, 09:14:34 pm »
We're not talking about whether either could reach infinity, we're talking about the value of the count of numbers in the series.  Integers have 2 x (count of whole numbers) + 1 items.  Assuming (count of whole numbers) is infinity, the count of integers is 2x(whole numbers count infinity) + 1, which makes it a bigger infinity.

If you put (whole numbers count infinity) / (count of integers infinty) you'd get a value infinitesimally approaching 0.5 from the left.
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [JAVA] Calculate Pi!
« Reply #63 on: November 16, 2005, 09:20:30 pm »
Aah, I see what you're saying now.  :)

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [JAVA] Calculate Pi!
« Reply #64 on: November 16, 2005, 09:35:50 pm »
We're not talking about whether either could reach infinity, we're talking about the value of the count of numbers in the series.  Integers have 2 x (count of whole numbers) + 1 items.  Assuming (count of whole numbers) is infinity, the count of integers is 2x(whole numbers count infinity) + 1, which makes it a bigger infinity.

If you put (whole numbers count infinity) / (count of integers infinty) you'd get a value infinitesimally approaching 0.5 from the left.

Aha, you are correct; however, look at this mapping:

N| 1 2  3 4  5 6  7 ....
------------------------
Z| 0 1 -1 2 -2 3 -3 ....


Assuming we continue doing that to infinity, we can convert any natural number to an integer:
Z
  • = N
  • / 2   --> if x is even and not 0

Z
  • = -(N
  • / 2) + 1 --> if x is odd and not 0

Z
  • = 0 --> if x = 0


So, for every integer Z
  • , there's a corresponding natural number N
  • , and vice versa.  So there aren't twice as many, since there is a 1:1 mapping.  Despite the fact that for every natural number, there's two integers, there's still a one-to-one mapping. 


Isn't infinity great? :)

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [JAVA] Calculate Pi!
« Reply #65 on: November 16, 2005, 10:55:25 pm »
Perhaps, but there's also a 2:1 mapping! :P
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [JAVA] Calculate Pi!
« Reply #66 on: November 16, 2005, 11:23:40 pm »
e is like pi, I believe. My ti-83 says it's approximately 2.71828182. If by "like infinity" you mean not a number, then no, it's a number. It's more like Pi in that they are both irrational numbers. I would, however, relate it more closely to phi (phi is approximately 1.618...), because both were discovered frequently in nature. Phi is a very interresting number.

-EDIT-
Quote
The only possible way I could think to produce ∞ from an equation would be x*0=0. But as that is undefined, I do not see any other way.
x*0 equals 0. It's defined as 0, isn't it? anything * 0 is 0, or so I thought.

I think those things have already been mentioned. :P

x * 0 = 0 is one way to think of infinitie, but since you can't devide by zero due to mathematical laws, it's undefined, not infinite.


Technically, dividing something means splitting it into equal piles. A good way of thinking of this is dealing cards. How do you deal cards to 0 people?
52/0 = 0R52 (you didn't give anyone any cards) = 1.

Division by 0 equals 1.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [JAVA] Calculate Pi!
« Reply #67 on: November 16, 2005, 11:43:59 pm »
Technically, dividing something means splitting it into equal piles. A good way of thinking of this is dealing cards. How do you deal cards to 0 people?
52/0 = 0R52 (you didn't give anyone any cards) = 1.

Division by 0 equals 1.

No, division by 0 = undefined.  Try it on any calculator.  That's why there's an error in games and things of this nature that reads "Error: Cannot divide by 0."

Lern 2 do math

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [JAVA] Calculate Pi!
« Reply #68 on: November 16, 2005, 11:48:32 pm »
e is like pi, I believe. My ti-83 says it's approximately 2.71828182. If by "like infinity" you mean not a number, then no, it's a number. It's more like Pi in that they are both irrational numbers. I would, however, relate it more closely to phi (phi is approximately 1.618...), because both were discovered frequently in nature. Phi is a very interresting number.

-EDIT-
Quote
The only possible way I could think to produce ∞ from an equation would be x*0=0. But as that is undefined, I do not see any other way.
x*0 equals 0. It's defined as 0, isn't it? anything * 0 is 0, or so I thought.

I think those things have already been mentioned. :P

x * 0 = 0 is one way to think of infinitie, but since you can't devide by zero due to mathematical laws, it's undefined, not infinite.


Technically, dividing something means splitting it into equal piles. A good way of thinking of this is dealing cards. How do you deal cards to 0 people?
52/0 = 0R52 (you didn't give anyone any cards) = 1.

Division by 0 equals 1.
By your example, you'd be giving out cards forever, because you'd be sitting there with the deck giving one to each of the 0 people.  So your deck would never lose a card.  So it would work out to infinity, or undefined, depending on how long you sit around, I suppose..

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [JAVA] Calculate Pi!
« Reply #69 on: November 17, 2005, 12:28:49 am »
By your example, you'd be giving out cards forever, because you'd be sitting there with the deck giving one to each of the 0 people.  So your deck would never lose a card.  So it would work out to infinity, or undefined, depending on how long you sit around, I suppose..

Hehe, exactly. :D

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [JAVA] Calculate Pi!
« Reply #70 on: November 17, 2005, 08:44:49 pm »
e is like pi, I believe. My ti-83 says it's approximately 2.71828182. If by "like infinity" you mean not a number, then no, it's a number. It's more like Pi in that they are both irrational numbers. I would, however, relate it more closely to phi (phi is approximately 1.618...), because both were discovered frequently in nature. Phi is a very interresting number.

-EDIT-
Quote
The only possible way I could think to produce ∞ from an equation would be x*0=0. But as that is undefined, I do not see any other way.
x*0 equals 0. It's defined as 0, isn't it? anything * 0 is 0, or so I thought.

I think those things have already been mentioned. :P

x * 0 = 0 is one way to think of infinitie, but since you can't devide by zero due to mathematical laws, it's undefined, not infinite.


Technically, dividing something means splitting it into equal piles. A good way of thinking of this is dealing cards. How do you deal cards to 0 people?
52/0 = 0R52 (you didn't give anyone any cards) = 1.

Division by 0 equals 1.
Division is more accurately described as "division among/between".  IE: Division by 1 means "division among 1", and thus the source remains whole, as it all goes to 1 "thing".