On Sat, Dec 25, 2010 at 04:28:36PM -0800, Eviatar wrote:
> My function implements the construction of a sequence. For example:
>
>         sage: DeBruijnSequence(2,3)
>         [0, 0, 0, 1, 0, 1, 1, 1]
> 
> Also this:
> 
>         sage: DeBruijnSequence(['foo','bar'],3)
>         ['foo', 'foo', 'foo', 'bar', 'foo', 'bar', 'bar', 'bar']
> 
> However, there are multiple possible outputs. Since these sequences
> are cyclical, many are redundant. As well, the number of these
> sequences for given inputs can become very large. In all uses of De
> Bruijn sequences I've encountered, only one of the outputs is used.
> Most of the algorithms for generating De Bruijn sequences also just
> generate one.

Thanks for the clarification!

I don't remember meeting this use case so far. I guess:

        sage: DeBruijnSequences(['foo','bar'],3).first()

or

        sage: DeBruijnSequences(['foo','bar'],3).an_element()

would do. Though I agree that this is a bit of an overkill if this is
the only operation that is ever going to be implemented on de Bruijn
sequences. So I could be convinced to just keep the current name as in
your example.

> The problem is that, as a consequence of generating one output, many
> of the standard methods for combinatorial objects (such as .list())
> will not be applicable here. Is this acceptable?

Definitely. There are for example enumerated sets in Sage where even
just deciding whether the set is finite or not is only semi-decidable;
so implementing count would be impossible.

Cheers,
                                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to