Ask Your Question
0

Enumerate elements of a set built using properties

asked 13 years ago

oscarvarto gravatar image

updated 13 years ago

Mike Hansen gravatar image

How can I enumerate all the elements of a set?

For example (I'll use latex to describe the desired set) if the set is:

W=ui[j],¯ui[j]:1in,1jm

Preview: (hide)

Comments

Explain what u_i[j] and \bar{u}_i[j] mean.

benjaminfjones gravatar imagebenjaminfjones ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 13 years ago

Mike Hansen gravatar image

I don't know what your u_i[j]'s are, but you can do things like the following

sage: m = 2; n  = 3
sage: [ (i,j) for i in range(m) for j in range(n)]
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]

where you would replace (i,j) with the Python/Sage version of your u_i[j]'s.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 13 years ago

Seen: 372 times

Last updated: Oct 19 '11