• 0 Posts
  • 3 Comments
Joined 2 years ago
cake
Cake day: June 16th, 2023

help-circle


  • I didn’t really understand the details of what you’re making, but if you want to generate a random variable with entropy x, the straightforward approach would be to use Σ = { n | 1≤n≤⌈2^x⌉ } as the alphabet and start with a uniform distribution (which overshoots the entropy target) and slightly skew the distribution to reduce entropy to hit the target x. Then you can map Σ to your desired set (f64 or Vec<f64> in your case?) using an injection, since that preserves entropy.