Groups | Search | Server Info | Login | Register


Groups > comp.specification.z > #80

Re: specifying randomness

From dtopham <dtopham@gmail.com>
Newsgroups comp.specification.z
Subject Re: specifying randomness
Date 2011-06-02 14:11 -0700
Organization http://groups.google.com
Message-ID <245f6279-e177-48ff-9941-eb7c2dc50b1b@j13g2000pro.googlegroups.com> (permalink)
References (2 earlier) <E6D93F03-5B60-4C49-9649-91FDE977719F@hud.ac.uk> <87b2603b-7c3a-473a-8e8d-4f146bacc539@j13g2000pro.googlegroups.com> <A9E6FBE5-75F3-4189-88FE-20A395FE285D@hud.ac.uk> <e3f1ba7f-617a-4b63-bb92-8f46528fcac1@d26g2000prn.googlegroups.com> <B9BFC854-E96F-4EAE-939C-370982E5EA2C@lemma-one.com>

Show all headers | View raw


I copied Rob's original spec here and made the correction in pick.
Now I am trying to understand how to modify this to match my original
goal
of specifying a random permutation of a sequence. e.g. If
seq of CHAR is "abc", then "bca" could qualify as random if there
is an equal likelihood of getting that permutation over any of
the other 6 possibilities. The main difference I see is that
instead of OUTCOME having 2 possibilities, it would have
6 (or more generally #(s : seq CHAR) factorial).
The f in pick would then be a function mapping
position in the sequence of each character to its position in
the permutation.  I believe SEED is not just the first value
given to the random number generator, but could be any of
random values returned from a language libraries random
function, but I notice that here Rob has put requirement
that the number of SEEDs be an even number (since OUTCOME has 2
possibilities).
So, in my problem I should require the set of random numbers to
be evenly divisible by 6? That is an interesting idea, since I don't
usually
see programs generating random numbers putting restrictions
on them like that. Is that needed to make the probability accurate?
For example, if we are modeling a coin flip, and we allow the range of
possible random numbers to be an odd number, then it would not
be accurate? For a coin flip, this would make only a small difference,
but
for a fair dice roll, it would be more important.?

> OUTCOME ::= Head | Tail

> | SEED : F_1 Z
> +--------
> | #SEED mod #OUTCOME = 0

> | pick : SEED -> OUTCOME
> |----------
> | forall f : OUTCOME @ #(pick~ (| {f} |)) = #SEED div #OUTCOME
>
> - Flip ------
> | seed? : SEED
> | outcome! : OUTCOME
> +--------
> | outcome! = pick seed?
> ------------

Back to comp.specification.z | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

specifying randomness dtopham <dtopham@gmail.com> - 2011-05-25 21:43 -0700
  Re: specifying randomness RJB <rbotting@csusb.edu> - 2011-05-26 08:15 -0700
    Re: specifying randomness m.m.west@hud.ac.uk (Margaret West) - 2011-05-26 16:42 +0100
      Re: specifying randomness dtopham <dtopham@gmail.com> - 2011-05-26 11:38 -0700
        Re: specifying randomness M.M.West@hud.ac.uk (Margaret West) - 2011-05-26 22:04 +0100
          Re: specifying randomness dtopham <dtopham@gmail.com> - 2011-05-28 20:52 -0700
            Re: specifying randomness rda@lemma-one.com (Rob Arthan) - 2011-05-29 10:51 +0100
              Re: specifying randomness Phil Clayton <phil.clayton@lineone.net> - 2011-05-31 11:42 -0700
                Re: specifying randomness dtopham <dtopham@gmail.com> - 2011-05-31 12:46 -0700
                Re: specifying randomness rda@lemma-one.com (Rob Arthan) - 2011-05-31 22:16 +0100
                Re: specifying randomness M.M.West@hud.ac.uk (Margaret West) - 2011-05-31 22:41 +0100
              Re: specifying randomness RJB <rbotting@csusb.edu> - 2011-06-01 06:57 -0700
                Re: specifying randomness rda@lemma-one.com (Rob Arthan) - 2011-06-01 15:10 +0100
                Re: specifying randomness RJB <rbotting@csusb.edu> - 2011-06-08 13:43 -0700
              Re: specifying randomness dtopham <dtopham@gmail.com> - 2011-06-02 14:11 -0700
                Re: specifying randomness rda@lemma-one.com (Rob Arthan) - 2011-06-04 15:27 +0100
                Re: specifying randomness m.m.west@hud.ac.uk (Margaret West) - 2011-06-06 23:46 +0100
                Re: specifying randomness M.M.West@hud.ac.uk (Margaret West) - 2011-06-06 23:48 +0100
    Re: specifying randomness David Lamb <dalamb@cs.queensu.ca> - 2011-05-26 11:55 -0400
  Re: specifying randomness rbotting@csusb.edu (RBotting) - 2011-05-26 10:25 -0700
    Re: specifying randomness m.m.west@hud.ac.uk (Margaret West) - 2011-05-26 18:52 +0100

csiph-web