Search the web
Sign In
New User? Sign Up
frink
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How do you spell "interval?"   Message List  
Reply | Forward Message #40 of 257 |

I'm working on implementing interval arithmetic in Frink. Interval
arithmetic is cool--instead of a number being a single value, an
interval can contain a range of (real) values.

For example, a baseball is allowed to have a circumference between 9
and 9 1/4 inches, and a mass between 5 and 5 1/4 ounces. This will be
able to be directly expressed in Frink:

circumference = [9 inches, (9 + 1/4) inches]
mass = [5 ounces, (5 + 1/4) ounces]

You can then write the rest of your calculations normally:

radius = circumference / (2 pi)
volume = 4/3 pi radius^3
density = mass / volume

And Frink will track the range of possible values through all
calculations. The final density will itself be an interval.

It'll be very cool. You can write many programs in the normal way,
and just "feed" them with interval values, and Frink will automagically
calculate your error bounds for you.

Many old programs will just magically start to work with intervals.
They won't all work -- the problem is that some operators and functions
aren't always meaningful when applied to intervals.

For instance,
2 < [3,4] is true. 2 is smaller than the lower bound.
3.5 < [3,4] is indeterminate. (How to handle?)
5 < [3,4] is false?? Indeterminate? I dunno.

Not to mention the issues when you compare intervals to intervals.

The problem is that square brackets will be indistinguishable from an
array. So we have to come up with a different way to specify that
something's an interval. One could of course do:

a = new Interval[2,3]

But that's slightly cumbersome. So, what notation can we use for
intervals that's:

1.) Possible to type on an ordinary keyboard
2.) Uses only ASCII characters
3.) Unambiguous
4.) Doesn't force change of existing syntax.
5.) Quick to type
6.) Not too visually noisy
7.) Visually distinguishable from other constructs
8.) It should still kinda look like [2, 3]

We could use combinations of characters. _[2, 3] would work, I think.

We could use a special operator to indicate that something's an
interval. [3 interval 6]

We could use a function to create intervals.
i[2,3]

I like this one a lot, but it will prevent us from ever implicitly
multiplying a scalar and an array, because it's indistinguishable from
multiplying the complex unit "i" by an array. Not really a big deal.
In that case we'd just write i * [2,3]. However, a function call will
always be slower than something that's evaluated at compile time.

Something like [[ ]] doesn't work... it would be indistinguishable
from a 2-d array.

Also, there may be an interval triplet indicating a lower and upper
bound, and a best "center" value: [1, 1.5, 2]

So, who can come up with the best way to write intervals concisely?

Sun is working on a new language called "Fortress" (
http://research.sun.com/projects/plrg/fortress0618.pdf )
that plans on having intervals. They've decided to use some wacky
Unicode brackets from the 298x range,
http://www.unicode.org/charts/PDF/U2980.pdf , which is fine for display
in Java 1.5 and later, but bad if you're writing command-line programs
in an old dumb shell, or targeting older Java releases (in which AWT
GUIs were broken, and you weren't guaranteed to have a working font on
any given machine.)

--
Alan Eliasen | "It is not enough to do your best;
eliasen@... | you must know what to do and THEN
http://futureboy.homeip.net/ | do your best." -- W. Edwards Deming



Sun May 22, 2005 2:26 am

aeliasen
Online Now Online Now
Send Email Send Email

Forward
Message #40 of 257 |
Expand Messages Author Sort by Date

I'm working on implementing interval arithmetic in Frink. Interval arithmetic is cool--instead of a number being a single value, an interval can contain a...
Alan Eliasen
aeliasen
Online Now Send Email
May 22, 2005
2:26 am

(i'm about to launch into an unfounded ramble through ideas, which may not go anywhere useful. feel free to skip to that much more interesting email from your...
Marcus Downing
shrink_laureate
Offline Send Email
May 22, 2005
11:18 pm

... To paraphrase Kirk's comment about Spock, "your unfounded ramble is as good as another man's well-considered reply." ... Actually, multiplying a scalar by...
Alan Eliasen
aeliasen
Online Now Send Email
May 23, 2005
2:59 am

... Ah, i didn't grok what intervals really were. I was thinking of them only in terms of their outer bounds, and simple calculations like + 2. Realizing that...
Marcus Downing
shrink_laureate
Offline Send Email
May 23, 2005
3:33 pm

... What about A .. B? Examples: for i = 0 .. 100 ; do fa[i] = f[i] + f[i-1]; done lunchtime = 12am .. 1pm if x in lunchtime; then do_lunchtime_event ; endif ...
Alan K. Stebbens
alan_stebbens
Online Now Send Email
May 23, 2005
6:34 am

... Marcus Downing also suggested this (and a few similar options) and I addressed it in my last reply. I understand if you didn't plow through that whole...
Alan Eliasen
aeliasen
Online Now Send Email
May 23, 2005
5:13 pm

... Hmm... well I'd definitely go with an object interface, just in case you wanted to add probabilities to the intervals next, or maybe define intervals in...
Edward Peschko
esp5@...
Send Email
May 23, 2005
7:58 pm

Wow. A fuzzy calculator. That really would be impressive. ... I did actually wonder about using a syntax like this, if no symbolic one presented itself. I...
Marcus Downing
shrink_laureate
Offline Send Email
May 23, 2005
10:51 pm

... That would be neat, but hard! Actually, maybe not that hard. If I understand the intent correctly, you could do something very similar by defining a few...
Alan Eliasen
aeliasen
Online Now Send Email
May 24, 2005
6:59 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help