> For the complete documentation index, see [llms.txt](https://docs.luckaton.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luckaton.com/technicals/randomization-framework/random.md).

# Random

## <mark style="color:purple;">Randomness</mark>

**Randomness** refers to the absence of any predictable pattern or bias, implying that all possible outcomes have an equal likelihood of occurring. This concept is contextual, depending on the pool of numbers or events from which randomness is drawn. For example, a fair [die](/luckaton-and-science/measurements/dice.md) has six faces, making each face's probability of landing 1/6.&#x20;

However, defining randomness becomes more complex with infinite sets, like natural numbers or real numbers between 0 and 1, where traditional notions of unbiased randomness don't apply due to their infinite nature.&#x20;

### <mark style="color:purple;">True Random Number Generators</mark>

A True Random Number Generator (TRNG) generates random numbers by monitoring natural phenomena, such as atomic decay or thermal noise. The debate on whether these processes are genuinely random or deterministic (e.g., if the universe operates as a simulation) is irrelevant for practical applications. What matters is their indistinguishability from authentic randomness.

### <mark style="color:purple;">Entropy</mark>

In the context of the Luckaton [Randomization Framework](/technicals/technical-architecture.md#randomization-framework), entropy is pivotal for securing seed values used in cryptographically secure random number generators (RNGs). Entropy refers to the degree of unpredictability or randomness in data, serving two key roles:

* As a measure of unknown information in data.
* As a source of unknown, unpredictable data itself.

#### <mark style="color:blue;">**Application and Measurement**</mark>

In an ideal scenario, a random boolean or a coin flip would yield 1 bit of entropy. However, any bias reduces this value. The framework assesses entropy through measures like Shannon Entropy to quantify the randomness.

A practical example within the framework is the use of Unix time-stamps, which blend high- and low-resolution data. The entropy value here depends on an attacker’s precision in guessing the time-stamp.

<mark style="color:blue;">**Entropy Extraction Technique:**</mark> [<mark style="color:blue;">**JitterRng**</mark>](#user-content-fn-1)[^1]

This method is specifically designed to harvest entropy from nanosecond-resolution timers. By conservatively estimating the entropy available per time-stamp and conducting tests on timer quality, JitterRng effectively enhances the framework's randomness. This technique acknowledges the varying degrees of entropy depending on an attacker's ability to guess time-stamps to the nearest minute or second.

***

By meticulously measuring and extracting entropy from available data sources, the framework ensures a secure and fair gaming experience, underpinning the robustness of RNGs used in the gaming environment.

[^1]: A true *random number generator* based on *jitter* in the CPU execution time, and *jitter* in memory access time.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.luckaton.com/technicals/randomization-framework/random.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
