DoubleX RMMV Partitioned Random

Note

This plugin's available for commercial use.

Purpose

Lets users changes the number of partitions the RNG being run per Math.random() call to control the RNG distributions on the fly

Games using this script

None so far

Plugin Call

Spoiler
* # Configuration manipulations * 1. DoubleX_RMMV.Partitioned_Random.parts * - Returns the value of parts under DoubleX_RMMV.Partitioned_Random * 2. DoubleX_RMMV.Partitioned_Random.parts = val * - Sets the value of parts under DoubleX_RMMV.Partitioned_Random as * val * - No DoubleX_RMMV.Formulae_Edit.parts change will be saved
Configurations

Spoiler
 * @param parts * @desc RNG will be run under each of parts equal-sized partitions *       No partition will be run under twice before they've all been run under *       parts shouldn't be too large nor too small to maximize the chance for *       the RNG generated by Math.random() to be more evenly distributed *       Larger parts means more resources(mainly time) needed to run it * @default 10
Prerequisites

Nothing special

Terms Of Use

You shall keep this plugin's Plugin Info part's contents intact

You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases

None of the above applies to DoubleX or his/her aliases

Changelog

Spoiler
 *      v1.00b(GMT 1300 11-11-2015):                                           *      1. Added descriptions that will be shown in the plugin manager         *      v1.00a(GMT 1300 24-10-2015):                                           *      1. 1st version of this plugin finished                               
DoubleX RMMV Partitioned Random v100b.rar
Did I get this right? I have the following problem: I use a control variables and set them to random, after this I create a conditional branch, so that the answers from the npcs won't be the same, however I often noticed that the random algorithm from RPG Maker MV wasn't so good, so the answers were still repetitve, even though I used a random variable. Does this plugin fix it? That would be awesome. 
Did I get this right? I have the following problem: I use a control variables and set them to random, after this I create a conditional branch, so that the answers from the npcs won't be the same, however I often noticed that the random algorithm from RPG Maker MV wasn't so good, so the answers were still repetitve, even though I used a random variable. Does this plugin fix it? That would be awesome. 
I'll use an example to illustrate.

Let's say parts is set as 10, and Math.random() is used.

The default behavior of Math.random() is to return a random number that's larger than or equal to 0 and smaller than 1, i.e., [0, 1).

With parts being set as 10, the random numbers will be divided into the below 10 partitions:

1- [0, 0.1)

2- [0.1, 0.2)

3- [0.2, 0.3)

4- [0.3, 0.4)

5- [0.4, 0.5)

6- [0.5, 0.6)

7- [0.6, 0.7)

8- [0.7, 0.8)

9- [0.8, 0.9)

10- [0.9, 1)

Then every 10 consecutive Math.random() call will always results in random numbers in different partitions, until all partitions are "used", then all those partitions will be "reset" and can be used again.

For instance: calling Math.random() 20 times consecutively can result in something like this:

Spoiler
0.5583369022811258 // 6 - [0.5, 0.6)0.8856774551202906 // 9 - [0.8, 0.9)0.7053351634934172 // 8 - [0.7, 0.8)0.2910141721648054 // 3 - [0.2, 0.3)0.46443921703774416 // 5 - [0.4, 0.5)0.34247765359444715 // 4 - [0.3, 0.4)0.9611230852360236 // 10 - [0.9, 1)0.170055669517572 // 2 - [0.1, 0.2)0.6280946076323228 // 7 - [0.6, 0.7)0.09900382018076581 // 1 - [0, 0.1)0.49970969353564276 // 5 - [0.4, 0.5) (all the 10 partitions are "used" after the 1st 10 consecutive Math.random() call and thus reset to be able to be "used" again)0.19670031315146652 // 2 - [0.1, 0.2)0.6183234115814623 // 7 - [0.6, 0.7)0.9592661473226407 // 10 - [0.9, 1)0.837747307203645 // 9 - [0.8, 0.9)0.06670947818157003 // 1 - [0, 0.1)0.20614586616388186 // 3 - [0.2, 0.3)0.38808043042462215 // 4 - [0.3, 0.4)0.7973840400497697 // 8 - [0.7, 0.8)0.5467456358572309 // 6 - [0.5, 0.6)
P.S.: I almost forgot to mention this plugin call:

DoubleX_RMMV.Partitioned_Random.parts = val // Changes the number of partitions on the flySo in your case, when the number of choices is 4, you can use:

DoubleX_RMMV.Partitioned_Random.parts = 4When there's another choice list with the number of choices being 6, you can use:

Code:
DoubleX_RMMV.Partitioned_Random.parts = 6
Updates

Code:
 *      v1.00b(GMT 1300 11-11-2015):                                           *      1. Added descriptions that will be shown in the plugin manager

Original thread: https://forums.rpgmakerweb.com/threads/doublex-rmmv-partitioned-random.46818/