>> - If you iterate on it, you just get finite words Well, first there *IS* a bug there :
sage: Words(3,finite=False)[1] word: 1 This word is finite while I asked for the set of infinite words. The patch at #12867 fixes it by refusing to return the first element (no iteration). So for a start, the set of infinite words should not return finite words, either through __iter__ or through .random_element() (which is the case right now). Though I think we agree on that. > So? If you iterate over ZZ you never get numbers > 10^20. Well, that's the difference between maths and implemented stuff. Do you think we should return "infinity" when asked for the cardinality or N, or R ? You will never list infinitely many, and you will never use more than 2^50 I guess. So why do we return +oo ? That's only maths. And I felt like somehow, iterating over a set of elements should only be possible when this set is countable. > The rest of your email is just pointing out that there is no uniform > probability measure on infinite sets. Well. I actually implemented a random_element method in #12867 for infinite words on a finite alphabet. It returns an infinite word, each of whose letter is randomly and uniformly taken. I think that it makes sense. > Again, so what? And how is that > different from the case of countable but infinite sets? Well. I always assumed that we should only implement a random_element() method when it was somehow uniform ? Otherwise let's write random_element = an_element and solve the problem forever :-P Nathann -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/groups/opt_out.