How FlashRNG Works
← Back to Home
Random Number Generation Method
FlashRNG leverages the inherent electronic noise present in your mobile device's camera sensor to generate true random bits. Here's how it works:
-
Accessing the Camera Feed:
The app accesses your front-facing camera to display a live video feed.
-
Capturing Frames:
Frames are captured from the video feed at a rate of 60 frames per second.
-
Processing Pixel Data:
Each frame is processed to retrieve pixel data, including the red, green, blue, and alpha (RGBA) values.
-
Generating Random Bits:
The pixel values are summed, and the least significant bit (LSB) of this sum is extracted to produce a random bit (0 or 1).
This method relies on sensor noise and environmental factors to produce randomness. Minor variations in light and electronic noise contribute to the unpredictability of the bits generated.
Z-Score Calculation
The z-score quantifies how much the observed number of '1's deviates from the expected number in a truly random sequence.
-
Collecting Data:
- Total Bits (N): The total number of bits generated.
- Sum of Bits (S): The total number of '1's.
-
Calculating Expected Mean and Variance:
- Expected Mean (μ): N / 2
- Variance (σ²): N / 4
-
Calculating the Z-Score:
Z = (S - μ) / σ, where σ = √(σ²)
A z-score close to 0 indicates that the generated bits are within the expected range for a random sequence.
Cumulative Deviation Graph
The cumulative deviation graph visualizes the deviation of the cumulative sum of generated bits from the expected mean over time.
-
X-Axis (Time): Represents the progression of time during the trial.
-
Y-Axis (Cumulative Deviation): Represents the cumulative deviation from the expected mean.
-
Calculating Cumulative Deviation:
For each time interval t:
- Cumulative Sum of Bits (Ct) = Sum of bits up to time t.
- Expected Cumulative Mean (Et) = t × (bits per second) × 0.5.
- Cumulative Deviation (Dt) = Ct - Et.
The graph helps identify patterns or trends that might indicate non-randomness in the bit generation process.
← Back to Home
This application is currently in beta.