Ignore:
Timestamp:
12/10/06 22:02:24 (6 years ago)
Author:
Nick Alexander <ncalexander@…>
Branch:
default
Children:
2110:3058a1513352, 2111:015c2a6ce65f
Message:

Fix doctests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/combinat/combinat.py

    r1855 r2109  
    707707         ['n', 'e'], ['s', 'i'], ['t', 'i'], ['e', 'i'], ['i', 'i'], ['n', 'i'], ['s', 'n'], 
    708708         ['t', 'n'], ['e', 'n'], ['i', 'n'], ['n', 'n']] 
    709         sage: mset = [x for x in GF(4,'a') if x!=0] 
    710         sage: tuples(mset,2) 
    711         [[1, 1], 
    712          [a, 1], 
    713          [a + 1, 1], 
    714          [1, a], 
    715          [a, a], 
    716          [a + 1, a], 
    717          [1, a + 1], 
    718          [a, a + 1], 
    719          [a + 1, a + 1]] 
     709 
     710    The Set(...) comparisons are necessary because finite fields are not 
     711    enumerated in a standard order. 
     712        sage: K.<a> = GF(4, 'a') 
     713        sage: mset = [x for x in K if x!=0] 
     714        sage: ts = tuples(mset,2) 
     715        sage: T = Set([tuple(t) for t in ts]) 
     716        sage: S = Set([(K(1), K(1)), (a, K(1)), (a + K(1), K(1)), (K(1), a), (a, a), (a + K(1), a), (K(1), a + K(1)), (a, a + K(1)), (a + K(1), a + K(1))]) 
     717        sage: S == T 
     718        True 
    720719 
    721720    AUTHOR: Jon Hanke (2006-08?) 
     
    997996    SAGE verifies that the first several coefficients do instead agree: 
    998997     
    999         sage: q = PowerSeriesRing(QQ,'q').gen() 
    1000         sage: prod((1-q^k)^(-1) for k in range(1,20))  ## partial product of  
    1001         1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + 30*q^9 + 42*q^10  
    1002         + 56*q^11 + 77*q^12 + 101*q^13 + 135*q^14 + 176*q^15 + 231*q^16 + 297*q^17 + 385*q^18  
    1003         + 490*q^19 + O(q^20) 
     998        sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() 
     999        sage: prod([(1-q^k)^(-1) for k in range(1,9)])  ## partial product of  
     1000        1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) 
    10041001        sage: [number_of_partitions_list(k) for k in range(2,10)] 
    10051002        [2, 3, 5, 7, 11, 15, 22, 30] 
Note: See TracChangeset for help on using the changeset viewer.