RE: the bugs that try men's souls

2005-04-06 Thread Delaney, Timothy C (Timothy)
Jordan Rastrick wrote: > I had a doozy myself the other night, writing a mergesort for python's > deque class (I can't believe it doesnt come with one!) Post it to the Cookbook ... ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: the bugs that try men's souls

2005-04-05 Thread Jordan Rastrick
Sean McIlroy wrote: > > Wow again. I had a real "V8 moment" when I looked at your solution > (smacking my forhead, groaning ruefully, etc). You were right: my > intention was simply to hide the trivial cases from view; I completely > missed the fact that I was now testing for membership in a diffe

Re: the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
Wow again. I had a real "V8 moment" when I looked at your solution (smacking my forhead, groaning ruefully, etc). You were right: my intention was simply to hide the trivial cases from view; I completely missed the fact that I was now testing for membership in a different set. I should have rememb

Re: the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
"Jordan Rastrick" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... Wow. I'd resigned myself to the task of reformulating my question in an intelligent way, I stopped by just to leave a little note to the effect that the thread wasn't dead, and I find out the question's been answ

Re: the bugs that try men's souls

2005-04-03 Thread Jordan Rastrick
I think I found your bug, although it took a bit of time, a fair bit of thought, and a fair bit of extra test-framework code - your program is very concise, reasonably complex, and very unreadable. Its perfect for testing maths theorems of your own interest, but you probably should have polished it

Re: the bugs that try men's souls

2005-04-03 Thread Serge Orlov
Sean McIlroy wrote: > This needs some background so bear with me. > > The problem: Suppose p is a permutation on {0...n} and t is the > transposition that switches x and y [x,y in {0...n}]. A "stepup pair" > (just a term I invented) for p is a pair (a,b) of integers in {0...n} > with a of p iff (p(

the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
This needs some background so bear with me. The problem: Suppose p is a permutation on {0...n} and t is the transposition that switches x and y [x,y in {0...n}]. A "stepup pair" (just a term I invented) for p is a pair (a,b) of integers in {0...n} with a> k = 18 moved = [i for i in range(l