On Sat, Apr 05, 2003 at 03:22:17PM -0700, Tom Christiansen wrote:
When you write:

(1..Inf) equal (0..Inf)

I'd like Perl to consider that false rather than having a blank look
on its face for a long time.

The price of that consideration would be to give the Mathematicians blank looks on *their* faces for a very long time instead. Certainly, they'll be quick to tell you there are just as many whole numbers as naturals. So they won't know what you mean by equal up there.

Based on his description, he meant element-wise equality. And since the first element of (1..Inf) is 1, and the first element of (0..Inf) is 0, I agree with the result being "false".


So no blank stare from me (student of mathematics)

The length of both will be Inf ofcourse (meaning countably infinite. I don't think we have a need for working with uncountably infinite sets in perl ;-)

Practically speaking, I'm not sure how--even whether--you *could*
define it.

You can define is very easily: two lists are equal if the ith element of one list is equal to the ith element of the other list, for all valid indices i.


As for whether you can *evaluate* this test in bounded time, that depends. Computers are incapable of storing truly infinite lists, so the lists will have finite internal representations which you can compare.

As for two dynamically generated infinite lists (which you can't easily compare, for example if they're based on external input)... it will either return false in finite time, or spend infinite time on determining they're indeed equal.

In other words, if you treat Inf as any particular number (which Mr
Mathematician stridently yet somewhat ineffectually reminds you that are
*not* allowed to do!), then you may get peculiar results.

There is no problem with doing that, as long as you define what you want it to do.


Remember, most of mathematics is just an invention of humans :)

(crap about testing first/last N elements)

testing the first/last N elements is not the same as testing the whole list


for all N :)


Mr Mathematician, purist that he is, has of course long ago thrown up his
hands in disgust, contempt, or both, and stormed out of the room

If he has, he's a very narrow-minded Mr Mathematician



how can you say 1+Inf?

Unless you're speech-impaired, it's not too hard


and 1..Inf will be problematic, too, since to say 1..Inf is also to say there must exist some number whose successor is Inf.

*cough*bullshit writing the interval 1..infinity is very common



I've skipped the rest.. not in the mood... but you make many references to a Mr Mathematician I don't think I want to work with... luckily I haven't seen him around here at the maths faculty


--
Matthijs van Duin  --  May the Forth be with you!

Reply via email to