Fact-Checking: Do seed(5) and seed(-5) produce the same random stream?
This occurs because Python's random module processes integer seeds using their absolute values. When you pass a negative integer like -5, the random module internally uses the absolute value (5) to initialize the random number generator state.
We tested multiple seed types and values to understand the pattern:
| Seed Type | Values Tested | Identical Sequences |
|---|---|---|
| Integers | 5, -5, 1, -1, 123, -123 | ✓ YES |
| Floats | 3.14, -3.14 | ✗ NO |
| Strings | "test" | N/A |
Python's random module processes seeds as follows:
Test different seed values yourself:
Testing Approach:
Scope of Findings:
Access the complete experimental data for reproducibility:
JSON Data Python Test Script