Re: Dimension of sequences

new topic     » goto parent     » topic index » view thread      » older message » newer message

Al Getz wrote:
> 
> Hello again,
> 

Hello Al! Thanks for your comments.

> 
> The game of chess if often referred to as having move sequences that
> exist on the edge of a multi-dimensional object, so i suppose
> you could say the same thing about a sequence.
> 

Sorry, I didn't understand this.

> My question would be say you defined the 'dimension' of a sequence
> as the product of the max of all the inner sequences written out
> such as 1x2x3 as is sometimes customary with arrays.  What would
> you use this information for in a program?
> 

Examples:
a)A 2D sequence (a matrix) can represent a system of simultaneous linear
equations. Then, you can use your description (a x b) to find out if the system
has possibly none, one or many solutions.
b)To know if a sequence represent a square matrix. For example, to know if you
can calculate its determinant.

> When i did my jpeg decoder program in Euphoria i used sequences
> like arrays where every level had the same length:
>   s=repeat(0,10)
>   s=repeat(s,4)
>   s=repeat(s,9)
>   s=repeat(s,5)
> and this builds up a structure similar to a C style array where
> every level has the same length.

That is what I'm calling rectangular sequence. Perhaps we could call it "array
sequence".

>  The above code creates 5 
> three dimensional 'arrays' that can be accessed by index.
> I would have no problem calling this a 10x4x9x5 or a 5x9x4x10
> 'sequence', 

Ok, you can call this way, but this isn't the dimension that I was talking
about. This is the number of atoms (after you compute the product).

>but the actual common useage seems to be to use
> every element, but then again i could easily see an app that
> although includes a given element, does not in fact use that
> element in the program, ever, and of course the implication of
> this is that an element missing altogether (only possible with 
> a sequence) does not necessarily decrease the length because
> the other sequences at the same level contain more elements:
>   s={
>       {1,2,3,4},
>       {5,6,7}
>     }
> is still a 2x4 sequence.
> 

If this is true, why *can't* I sum, subtract, multiply, etc, sequences with the
same description ?
The information of the structure of the sequence is lost in that representation.
I think if you eliminate an atom of a retangular sequence (array sequence), it
can't have the same description any longer.

> If you want to get more detailed, you might have to start enumerating
> every element and returning a sequence that corresponds to that
> sequence.  As with the above, this would be:
>   m={4,3}
> I guess this would simply be a sequence with the lengths of all 
> first level sequences arranged in the same structure as the
> original sequence, which would still have to be perused.
> Again i would have to wonder about how useful this would be unless
> the sequence isnt that big.  For example, "When do i need to know
> the actual structure of the sequence in full?"
> 

To serialize sequences, which is necessary in several situations: saving and
restoring sequences to/from files, transmission of sequences via serial networks.

> Some applications would be interesting to hear about at this point.
>

Any application that uses EDS, save and restore the full structures of sequences
to/from the database.
 
> 
> Al
> 
> E boa sorte com sua programacao Euphoria!

Obrigado. Para voce tambem!

> 
> 
> My bumper sticker: "I brake for LED's"
> 

Regards,
   Fernando

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu