[Tutor] A small math puzzle [recreational Python]

Blake Winton bwinton@tor.dhs.org
Sat, 5 Jan 2002 17:49:49 -0500


* Kirby Urner <urnerk@qwest.net> [020105 14:01]:
> At 12:51 PM 1/5/2002 -0500, Blake Winton wrote:
> >* Kirby Urner <urnerk@qwest.net> [020105 11:23]:
> > > A permutations with no element in its original position is
> > > called a derangement.
> >But does this take into account the fact that two letters might
> >be the same?  I believe the puzzle, as stated, is a little
> >trickier than this formula would account for.
> I hope you don't mind my posting this CC to the list,

I didn't think it was worthy of a post, but now that I think
about it a little more, it's a devilish twist...

> I expect there's a modification of the above formula that
> would accommodate repetitions of elements.  I'd like to
> find out what it is.

I thought so at first, but then I started thinking about it
a little more...

For instance, the string "DDT" has no derangement, and I'm
not sure how we'ld take that into account.

Later,
Blake.
-- 
9:40pm up 52 days, 21:07, 2 users, load average: 0.02, 0.09, 0.07