| 
              
                
                  
                   | 
            
            
              
              
                
      
    
                
                 | 
            
            last edited 11 years ago by Bill Page | 
| 1 2 3 4 5 6 | ||
| 
              Editor: Bill Page
               Time: 2014/10/08 18:34:06 GMT+0  | 
          ||
| Note: tidy | ||
removed:
-j:IndexedOneDimensionalArray(NonNegativeInteger,3):=construct [i for i in 1..3]
-j(0):=j(0)+1
-j
        | (1) | 
(1) -> <spad>
)abbrev package CHOO Choose
Choose(X:SetCategory): with
    choose:(List X, NonNegativeInteger) -> List List X
  == add
    choose(S, k) ==
      j:List NonNegativeInteger := [i for i in 1..k]
      R:List List X := [[S(j(i)) for i in 1..k]]
      n:Integer := k
      while n>0 and j(n)+k-n<#S repeat
        j(n):=j(n)+1
        for i in n..k-1 repeat j(i+1):=j(i)+1
        R:=concat(R, [S(j(i)) for i in 1..k])
        n:=k; while j(n)+k-n>=#S and n>1 repeat n:=n-1
      if binomial(#S, k)~=#R then error "error in choose"
      return R</spad>
Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5705694974207640903-25px001.spad
      using old system compiler.
   CHOO abbreviates package Choose 
------------------------------------------------------------------------
   initializing NRLIB CHOO for Choose 
   compiling into NRLIB CHOO 
   compiling exported choose : (List X, NonNegativeInteger) -> List List X
Time: 0.04 SEC.
(time taken in buildFunctor:  0)
Time: 0 SEC.
   Cumulative Statistics for Constructor Choose
      Time: 0.04 seconds
   finalizing NRLIB CHOO 
   Processing Choose for Browser database:
--->-->Choose(constructor): Not documented!!!!
--->-->Choose((choose ((List (List X)) (List X) (NonNegativeInteger)))): Not documented!!!!
--->-->Choose(): Missing Description
; compiling file "/var/aw/var/LatexWiki/CHOO.NRLIB/CHOO.lsp" (written 24 SEP 2025 10:42:58 PM):
; wrote /var/aw/var/LatexWiki/CHOO.NRLIB/CHOO.fasl
; compilation finished in 0:00:00.036
------------------------------------------------------------------------
   Choose is now explicitly exposed in frame initial 
   Choose will be automatically loaded when needed from 
      /var/aw/var/LatexWiki/CHOO.NRLIB/CHOO| (2) | 
choose([r[q] for q in 1..4|q~=3],2) 
| (3) | 
| (4) | 
choose([r[q] for q in 1..4|q~=3],2).2 
| (5) | 
choose([1],1) 
| (6) | 
choose([1,2], 1) 
| (7) | 
choose([1,2], 2) 
| (8) | 
choose([1,2, 3], 1) 
| (9) | 
choose([1,2, 3], 2) 
| (10) | 
choose([1,2, 3], 3) 
| (11) | 
choose([x,y, z, w], 1) 
| (12) | 
choose([x,y, z, w], 2) 
| (13) | 
choose([x,y, z, w], 3) 
| (14) | 
choose([x,y, z, w], 4) 
| (15) |