#13695: Subsets(1)[x] behaves strangely for x in SR
-----------------------------+----------------------------------------------
   Reporter:  ppurka         |             Owner:  sage-combinat
       Type:  defect         |            Status:  new          
   Priority:  major          |         Milestone:  sage-5.5     
  Component:  combinatorics  |          Keywords:               
Work issues:                 |   Report Upstream:  N/A          
  Reviewers:                 |           Authors:               
  Merged in:                 |      Dependencies:               
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 This bug is from the
 [https://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA sage
 notebook bug report page].
 {{{
 A = Subsets(1);
 k=var('k')
 sum((-1)^(A[k].cardinality()),k,0,A.cardinality()-1)

 Sage gives me 2 as an answer, while it should be 0.
 }}}

 The problem seems to be in `sage.combinat.subset.Subsets_s.unrank` which
 does not check whether the arguments it receives are integers or not. So,
 doing something like the title gives the empty set and so we get 2 as the
 answer above.
 {{{
 sage: Subsets(1)[x]
 {}
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13695>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to