Last year after less than two days I could finish
a calculation and write to William:

> -------- Original Message --------
> Subject: dance(10)
> Date: Thu, 09 Mar 2006 00:10:19 +0100
> From: Jaap Spies <[EMAIL PROTECTED]>
> To: William Stein <[EMAIL PROTECTED]>
> 
> William,
> 
> Some time ago, dance(10) finished:
> 
> sage: time dance(10)
> [1, 90, 3405, 71040, 901152, 7225344, 36862960, 117340800, 221170456,
> 220658800, 87396728]
> h^10 - 35*h^9 + 675*h^8 - 8610*h^7 + 78435*h^6 - 523467*h^5 +
> 2562525*h^4 - 9008160*h^3 + 21623220*h^2 - 31840760*h + 21750840
> CPU times: user 141822.70 s, sys: 18387.03 s, total: 160209.74 s
> Wall time: 165997.13
> 
> 
> Jaap 

To day I got with sage-2.8.8.1:

> sage: time dance(10)
> 
> 
> ------------------------------------------------------------
> Unhandled SIGSEGV: A segmentation fault occured in SAGE.
> This probably occured because a *compiled* component
> of SAGE has a bug in it (typically accessing invalid memory)
> or is not properly wrapped with _sig_on, _sig_off.
> You might want to run SAGE under gdb with 'sage -gdb' to debug this.
> SAGE will now terminate (sorry).
> ------------------------------------------------------------

With sage -gdb:

> sage: time dance(9)
> h^9 - 27*h^8 + 414*h^7 - 4158*h^6 + 29421*h^5 - 148743*h^4 + 530796*h^3 - 
> 1276992*h^2 + 1866384*h - 1255608
> CPU times: user 1786.82 s, sys: 23.05 s, total: 1809.87 s
> Wall time: 1831.52
> 
> sage: time dance(10)
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1208523072 (LWP 30162)]
> 0x0064d473 in strlen () from /lib/libc.so.6
> (gdb)

The program (see below) uses methods from sage.matrix.matrix2.pyx



Jaap




##########################################################################
#  Copyright (C) 2006 Jaap Spies, [EMAIL PROTECTED]
#
#  Distributed under the terms of the GNU General Public License (GPL):
#
#                  http://www.gnu.org/licenses/
##########################################################################

"""
         Usage from sage

         sage: attach 'dancing.sage'

         sage: dance(4)
         h^4 - 2*h^3 + 9*h^2 - 8*h + 6

"""

# use variable 'h' in the polynomial ring over the rationals

h = QQ['h'].gen()

def dance(m):
     """
         Generates the polynomial solutions of the Dancing School Problem
         Based on a modification of theorem 7.2.1 from Brualdi and Ryser,
         Combinatorial Matrix Theory.

         See NAW 5/7 nr. 4 december 2006 p. 285

         INPUT: integer m

         OUTPUT: polynomial in 'h'

         EXAMPLE:
             sage: dance(4)
             h^4 - 2*h^3 + 9*h^2 - 8*h + 6

         AUTHOR: Jaap Spies (2006)
     """
     n = 2*m-2
     M = MatrixSpace(ZZ, m, n)
     A = M([0 for i in range(m*n)])
     for i in range(m):
         for j in range(n):
             if i > j or j > i + n - m:
                 A[i,j] = 1
     rv = A.rook_vector()
#   print rv
     s = sum([(-1)^k*rv[k]*falling_factorial(m+h-k, m-k) for k in range(m+1)])
     print s


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to