firstcomb - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

combinat

  

nextcomb

  

construct the lexicographic successor of a given combination

  

prevcomb

  

construct the lexicographic predecessor of a given combination

  

firstcomb

  

construct the lexicographically first combination

  

lastcomb

  

construct the lexicographically last combination

 

Calling Sequence

Parameters

Description

Thread Safety

Examples

Compatibility

Calling Sequence

nextcomb( s, n )

prevcomb( s, n )

firstcomb( n, k )

lastcomb( n, k )

Parameters

s

-

set(posint); a set of positive integers from 1 to n for some n

n

-

nonnegint; size of the set from which combination members are chosen

k

-

nonnegint; size of the combination

Description

• 

Given a combination p (of type set(posint)) of k integers chosen from {1,2, ..., n }, for some n, the command nextcomb returns the lexicographic successor of s.

  

If s is the lexicographically last combination (that is, { n - k + 1, n - k + 2, ..., n}), then the value FAIL is returned.

• 

Given a combination s (of type set(posint)) of k  integers chosen from {1,2, ..., n }, for some n, the command prevcomb returns the lexicographic predecessor of s.

  

If s is the lexicographically first combination (that is, {1,2, ..., k}), then the value FAIL is returned.

• 

The firstcomb command returns the lexicographically first combination of k elements chosen from {1, 2, ..., n }. This is the subset {1,2, ..., k}.

• 

The lastcomb command returns the lexicographically last combination of k elements chosen from {1,2, ..., n }, which is { n - k + 1, n - k + 2, ..., n }.

Thread Safety

• 

The combinat[nextcomb], combinat[prevcomb], combinat[firstcomb] and combinat[lastcomb] commands are thread-safe as of Maple 16.

• 

For more information on thread safety, see index/threadsafe.

Examples

(1)

(2)

(3)

(4)

(5)

(6)

(7)

Compatibility

• 

The combinat[nextcomb], combinat[prevcomb], combinat[firstcomb] and combinat[lastcomb] commands were introduced in Maple 16.

• 

For more information on Maple 16 changes, see Updates in Maple 16.

See Also

combinat

combinat[choose]

 


Download Help Document