W3C home > Mailing lists > Public > public-forms@w3.org > September 2011

This is a permutation, those aren't, was Re: XQuery (not XPath 2.0, or XPath 1.0) permutations

From: John Boyer <boyerj@ca.ibm.com>
Date: Wed, 21 Sep 2011 14:32:51 -0700
To: "Leigh L. Klotz, Jr." <Leigh.Klotz@Xerox.com>
Cc: public-forms@w3.org
Message-ID: <OF3D4B76D6.6E6D4422-ON88257912.00717730-88257912.00765D7E@ca.ibm.com>
Hi Leigh,

The author of the blog you cited is confused about what a permutation is. 
His code generated the power set of the given set, not the permutation 

For the set of four elements {a, b, c, d} he showed, there are 4!=24 
permutations, each of which has all four elements in a different order. 
Here's what they look like:

{a, b, c, d}
{a, b, d, c}
{d, c, b, a}

The problem we were discussing this morning was to randomly generate one 
permutation of a set of numbers so that the rearranged order of the 
numbers could be used as a lens to rearrange a set of choices presented by 
the itemset of a select or select1.

I just posted a blog entry [1] that shows the XForms needed to generate a 
permutation and then apply it to the itemset of a select1.


John M. Boyer, Ph.D.
Distinguished Engineer, IBM Forms and Smarter Web Applications
IBM Canada Software Lab, Victoria
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: 

From:   "Leigh L. Klotz, Jr." <Leigh.Klotz@Xerox.com>
To:     public-forms@w3.org, john.boyer@ca.ibm.com
Date:   09/21/2011 09:25 AM
Subject:        XQuery (not XPath 2.0, or XPath 1.0) permutations
Sent by:        public-forms-request@w3.org

Received on Wednesday, 21 September 2011 21:33:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:14:05 UTC