On Wednesday 05 September 2007 18:47, William Stein wrote:
> Or maybe you really want a free monoid?
>
> sage: M.<x,y> = FreeMonoid(2)
> sage: x*y*x*x*y
> x*y*x^2*y
> sage: (x*y*x*x*y)^3
> x*y*x^2*y*x*y*x^2*y*x*y*x^2*y

Yes, so I found FreeMonoid after sending my first e-mail and was testing it 
out.  I think I may have found something that is not implemented:

sage: a=FreeMonoid(1,'a').0
sage: a*a
a^2
sage: a.substitute(5)
a  # should be 5?
sage: a.substitute(a=5)
a  # should be 5?

I would have expected those last two results to be 5 -- am I missing 
something?  I guess substituting isn't an entirely common operation for free 
monoids, but it seems to be a sensibly defined operation.  Then again, maybe 
not:

sage: M.<x,y> = FreeMonoid(2)
sage: (x*y).substitute(x=1)
x*y  # I would think that this is 1*y

I find that result unsatisfactory as well, but I sure don't have a good idea 
about what ring (?) the result '1*y' would be a part of.

--
Joel

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to