2010/11/12 Neil Toronto :
> Jon Rafkind wrote:
>> On 11/12/2010 02:25 PM, Eli Barzilay wrote:
>>>
>>> Any objections to `shuffle' in `racket/list'?
>
> No objections here. I will almost surely use this function in the future.
>
>> Dumb question but is this different from `shuffle-list' from games/c
Jon Rafkind wrote:
On 11/12/2010 02:25 PM, Eli Barzilay wrote:
Any objections to `shuffle' in `racket/list'?
No objections here. I will almost surely use this function in the future.
Dumb question but is this different from `shuffle-list' from games/cards ?
Yes. The one in games/cards take
On 11/12/2010 02:25 PM, Eli Barzilay wrote:
> Any objections to `shuffle' in `racket/list'?
>
Dumb question but is this different from `shuffle-list' from games/cards ?
_
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo
Not by me.
On Fri, Nov 12, 2010 at 2:25 PM, Eli Barzilay wrote:
> Any objections to `shuffle' in `racket/list'?
>
> --
> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
> http://barzilay.org/ Maze is Life!
>
Any objections to `shuffle' in `racket/list'?
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
_
For list-related administrative tasks:
http://li
10 minutes ago, Robby Findler wrote:
> I think we want the one recommended by the statisticians. :)
+1, not only because it's more robust, but there's the obvious benefit
of adding a one-liner.
> On Fri, Nov 12, 2010 at 2:36 PM, Jay McCarthy wrote:
> > I think we should put in a list shuffler
I think we want the one recommended by the statisticians. :)
Robby
On Fri, Nov 12, 2010 at 2:36 PM, Jay McCarthy wrote:
> I think we should put in a list shuffler into the core.
>
> Which should we use? The faster one?
>
> Jay
>
> On Thu, Nov 11, 2010 at 11:26 AM, Eli Barzilay wrote:
>> 5 minut
I think we should put in a list shuffler into the core.
Which should we use? The faster one?
Jay
On Thu, Nov 11, 2010 at 11:26 AM, Eli Barzilay wrote:
> 5 minutes ago, Neil Toronto wrote:
>> Carl Eastlund wrote:
>> > It's "pick a random, uniform ordering, and then sort based on it".
>> > The ra
On Thu, Nov 11, 2010 at 10:26 AM, Eli Barzilay wrote:
> It's a very common method, and the classic example of the
> decorate-map-strip method that has some perl-guy's name slapped on it
> now.
http://en.wikipedia.org/wiki/Schwarzian_transform
_
Fo
When truly picking uniformally shuffled lists from a given list, see:
http://telefonica.net/web2/koot/natural-to-permutation.scm
and try
(require srfi/27) ; for random-integer
(require "natural-to-permutation.scm")
(let*
((lst (build-list 1000 (lambda (k) (round (quotient k 10)
(
5 minutes ago, Neil Toronto wrote:
> Carl Eastlund wrote:
> > It's "pick a random, uniform ordering, and then sort based on it".
> > The random keys are chosen per element and cached (hence
> > #:cache-keys? #t), not per comparison.
>
> Spanking good point, my good man. I think you're right.
It's
Carl Eastlund wrote:
On Thu, Nov 11, 2010 at 12:40 PM, Neil Toronto wrote:
I don't know. I know that the "run through the list and swap with another
random element" algorithms are usually non-uniform, and so are a lot of
other things that seem like they'd work. I wouldn't use something that
was
On Thu, Nov 11, 2010 at 11:40 AM, Carl Eastlund wrote:
> On Thu, Nov 11, 2010 at 12:40 PM, Neil Toronto wrote:
>>
>> I don't know. I know that the "run through the list and swap with another
>> random element" algorithms are usually non-uniform, and so are a lot of
>> other things that seem like
On Thu, Nov 11, 2010 at 12:40 PM, Neil Toronto wrote:
>
> I don't know. I know that the "run through the list and swap with another
> random element" algorithms are usually non-uniform, and so are a lot of
> other things that seem like they'd work. I wouldn't use something that
> wasn't proven to
Carl Eastlund wrote:
On Thu, Nov 11, 2010 at 12:18 PM, Neil Toronto wrote:
Eric Hanchrow wrote:
I find myself using this all the time; it seems it'd be handy to have
built in.
(define (shuffled list)
(sort list < #:key (lambda (_) (random)) #:cache-keys? #t))
Is the distribution of shuffled
I think that if random doesn't pick the same number twice you're
guaranteed to be independent of the sorting algorithm, at least.
Robby
On Thu, Nov 11, 2010 at 11:18 AM, Neil Toronto wrote:
> Eric Hanchrow wrote:
>>
>> I find myself using this all the time; it seems it'd be handy to have
>> buil
On Thu, Nov 11, 2010 at 12:18 PM, Neil Toronto wrote:
> Eric Hanchrow wrote:
>>
>> I find myself using this all the time; it seems it'd be handy to have
>> built in.
>>
>> (define (shuffled list)
>> (sort list < #:key (lambda (_) (random)) #:cache-keys? #t))
>
> Is the distribution of shuffled li
Eric Hanchrow wrote:
I find myself using this all the time; it seems it'd be handy to have built in.
(define (shuffled list)
(sort list < #:key (lambda (_) (random)) #:cache-keys? #t))
Is the distribution of shuffled lists uniform? That'd be hard to
analyze, since it would depend on the sor
I find myself using this all the time; it seems it'd be handy to have built in.
(define (shuffled list)
(sort list < #:key (lambda (_) (random)) #:cache-keys? #t))
Thanks.
_
For list-related administrative tasks:
http://lists.racket-lang.org/l
19 matches
Mail list logo