Path: news.mathworks.com!not-for-mail
From: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Derangement: efficient full permutation
Date: Tue, 1 Feb 2011 13:23:03 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 8
Message-ID: <ii91fn$5eo$1@fred.mathworks.com>
References: <ii8ut8$3fb$1@fred.mathworks.com> <ii90lg$qmd$1@fred.mathworks.com>
Reply-To: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1296566583 5592 172.30.248.48 (1 Feb 2011 13:23:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 1 Feb 2011 13:23:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:707420

Dear Bruno,

> Your algorithm surely has BUG, e.g., n = 1 it generate a derangement 1, which is impossible.

Yup. I've posted a reduced version only. In the full version I reject N=1 and reply [2,1] for N=2.
Do you see limitations for N>=3  --- except for the necessary warnings for e.g. N > 2^48 or complex N?

Kind regards, Jan