samedi 30 juin 2018

Is it faster, using coin flips, to generate random ints from 1 to 9, w/ single factor solving algorithms, or is it faster w/ multi-factor algorithms?

Is it faster, using coin flips, to generate random ints from 1 to 9, with single factor solving algorithms, or is it computationally faster with multi-factor solving algorithms?

Solving using one factorization, one would process solving attempts with four instances of f(2), for a four bit/process return, that has a function range of 2^4=16. For generating an int from 1 to 9 with f(2) per that method, 9 of the 16 results would be valid, & 7 possible returns per solving attempts would be solving attempt fail/retries. Hence, this single factorization method of generating rand ints from 1 to 9 has a 7/16=%44 solving attempt fail/retry rate for a four process function.

Using instead multiple factors algorithmmically, the solving attempt fail/retry rate may be reduced, comparatively?

First, two instances of f(2) could generate a random int from 1 to 4, accepting only returns from 1 to 3, with a %25 solving attempt fail/retry rate for a two process solving attempt function.

Next, another two instances of f(2) could generate another random int from 1 to 4, accepting only returns from 1 to 3, with another %25 solving attempt fail/retry rate for its two process solving attempt function.

The first rand int from 1 to 3 may be added to {3* ((the second rand int from 1 to 3 result)-1)} to yield a rand int from 1 to 9, that has a %25 fail/retry rate for solving attempts of its first two processes, followed by a %25 fail/retry rate for solving attempts of its next two processes.

The f(2) -> f(9) solving efficiency of the second proposed algorithm may be more efficient, because it uses multiple factors, instead of a single factor?

For discussion of creating a random number generator from a coin toss, see Creating a random number generator from a coin toss




Aucun commentaire:

Enregistrer un commentaire