[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: Re: A proposal:xsl:result-document asynchronou

Subject: Re: Re: Re: A proposal:xsl:result-document asynchronous attribute
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 11 Mar 2003 21:33:52 +0100
asynchronou
"Kurt Cagle" <kurt@xxxxxxxxxxxxx> wrote in message
news:003501c2e806$d24d8a20$892afc0a@xxxxxxxxxxxxxxxxx
> Nice. I'd missed this one. Any idea how even a distribution this gives?
>
> -- Kurt

Quite sufficient for almost all uses with the exception of encryption
algorithms, perhaps. But see for yourself the results produced:

http://fxsl.sourceforge.net/articles/Random/Casting%20the%20Dice%20with%20FX
SL-htm.htm#2._Generating_a_random_sequence_following_a_distribution.Subseque
nces.

For example:

100 Random outcomes 1-6 with distribution:
<myDistribution:myDistribution>
<o>1</o><p>0.2</p>
<o>2</o><p>0.25</p>
<o>3</o><p>0.25</p>
<o>4</o><p>0.15</p>
<o>5</o><p>0.1</p>
<o>6</o><p>0.05</p>
</myDistribution:myDistribution>

Results:

2, 5, 1, 4, 3, 1, 2, 5, 4, 2,
2, 2, 1, 3, 2, 5, 2, 3, 3, 1,
1, 5, 4, 2, 5, 2, 2, 1, 1, 2,
4, 3, 1, 3, 6, 1, 2, 4, 4, 6,
3, 1, 4, 6, 2, 5, 2, 1, 1, 4,
2, 4, 2, 4, 3, 1, 3, 3, 3, 1,
4, 1, 5, 4, 1, 2, 2, 1, 6, 4,
4, 4, 2, 6, 5, 3, 2, 4, 3, 2,
2, 2, 3, 2, 3, 5, 4, 5, 2, 1,
3, 1, 2, 1, 3, 4, 2, 3, 2, 1,

As it can be seen, 6 appears for the first time only at position 35, and the
total is 5 out of 100 -- exactly the specified distribution of 0.02.

Needless to say, The original algorithm belongs to Simon Thompson and was
shamelessly reused by me from his excellent book "Haskell: The Craft of
Functional Programming".


For an explanation why the node-set randomisation algorithm is not perfect,
see:

http://haskell.org/pipermail/haskell/2003-March/011403.html

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.