This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-01-28 15:36:01

anim8rXtreme
Scratcher
Registered: 2007-10-24
Posts: 5

infinity

I WANT to make a variable go to infinity.  How do I go about This?

Offline

 

#2 2008-01-28 15:43:15

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: infinity

Forever
Change Variable by 1

Now wait....

big_smile


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-01-28 16:08:40

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: infinity

Divide by zero


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2008-01-30 15:21:21

chalkmarrow
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: infinity

If you combine Mayhem's method with Paddle2See's method, you'll get there even faster...

Seriously, though infinity is not really a number, it's a symbol we use to talk about numbers. Plus there's many (at least two) different infinities, each having their own "cardinality." For example, there is the infinity of the integers (1, 2, 3...) and then there's the infinity of the real number line.

Last edited by chalkmarrow (2008-01-30 21:35:28)

Offline

 

#5 2008-01-30 15:45:40

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: infinity

actually, chalkmarrow, John's fixed the infinity bug in the new version. If you make a sprite go to an infinite coordinate, it just won't do it anymore (and display 'Infinity') in the variable watcher....


Jens Mönig

Offline

 

#6 2008-01-30 21:36:10

chalkmarrow
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: infinity

I modified my last post, Jens, to remove the reference to the now-fixed infinity bug...

Offline

 

#7 2008-01-31 11:08:26

pasta3049
Scratcher
Registered: 2007-10-18
Posts: 31

Re: infinity

when green flag clicked
forever
set variable to 2*variable

and then clich on the stop sign when the variable gets to infinity.

Offline

 

#8 2008-01-31 12:29:27

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: infinity

Problem is, you can't get to infinity by adding finite numbers.  Unless, as Mayhem points out, you are willing to wait an infinite amount of time for the "result".

Some philosophical discussion of Paddle2's suggestion, and infinity:

http://mathforum.org/dr.math/faq/faq.divideby0.html

-MrEd

Last edited by EdnaC (2008-01-31 14:56:59)

Offline

 

#9 2008-01-31 14:01:27

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: infinity

Hmmm.  So following EdnaC's link, Dr. Math says that dividing by zero does not give you infinity because the operation is not defined.  So maybe I should say that to get to infinity you should divide by successively smaller numbers approaching zero as a limit?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#10 2008-01-31 14:37:09

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: infinity

Dividing by zero is defined in scratch as returning infinity. This may not lead to a completely consistent mathematical system, but it is what IEEE floating-point math standards require.

Offline

 

#11 2008-01-31 15:10:47

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: infinity

I guess the IEEE had to decide on something for divide by zero.  But I'm pretty sure I can't use the IEEE "standard" for infinity and multiply it by zero to get my original number back!

1/0 = "IEEE Infinity"  therefore 0 * "IEEE Infinity" = 1

and also,

2/0 = "IEEE Infinity"  therefore 0 * "IEEE Infinity" = 2

So now, we have an infinite number of "infinities"...............

I'm still wondering why anim8tr wanted a variable to go to infinity, does it do something really nifty when it gets there?

-MrEd

Last edited by EdnaC (2008-01-31 22:21:42)

Offline

 

#12 2008-01-31 17:36:54

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: infinity

Scratch does display infinity nicely in the variable display now.

I believe that IEEE floating-point supports 2 infinities: positive and negative, and another value NaN (not a number), for things that really can't be defined (like 0/0 or 0*infinity).

Offline

 

#13 2008-02-01 07:41:58

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: infinity

Pretty neat, I constructed a loop to send a variable to infinity and pretty quickly got there:

Green Flag:
Set Big to 2

Forever
Change Big by Big*2

It happened pretty fast,  it looks like "infinity" was reported once the value exceeded the size of a "Double" (64bit floating point number).  Not really very spectacular, and definitely not satisfying to mathmatics philosophers, but 1.8X10^308 is close enough for me.

Out of curiosity, I googled to learn about the IEEE's decision on defining "divide by zero".  There is some contention on that decision. 

http://standards.ieee.org/reading/ieee/interp/754-1985.html

The IEEE decision is defended using the method Paddle2 suggested (dividing by successively smaller numbers) on the grounds that what the programmer "wanted" just couldn't be represented by the numbers available (a Double can be a really tiny number, but the programmer must have wanted one that was even smaller).  Dr Math would not be pleased!

-MrEd

Last edited by EdnaC (2008-02-01 07:43:16)

Offline

 

Board footer