Skip to content

Slight bias in conversion #1

@DaveCTurner

Description

@DaveCTurner

Hi,

The number you get from 100 dice rolls may have 65 hex digits, and this script throws away the first one to leave the remaining 64. This means that some of the possible outputs are twice as likely as the others. It's a tiny difference in practice, but it'd be nice if it at least warned you if the top digit was nonzero, as if you want an unbiased result then you should re-roll.

A slightly nicer approach (from a practical point of view) is to do the calculation as 4 sets of 25 rolls, each giving 16 hex digits. The chance of having to discard a straight 100 rolls due to bias is rather high (>80%), and re-rolling 100 dice is tedious. The chance of having to discard a block of 25 rolls is much lower (~35%) and the cost of re-rolling is much lower too.

Cheers,

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions