11 reputation
3
bio website
location
age
visits member for 1 year, 8 months
seen Jun 11 at 19:31

Apr
23
awarded  Student
Apr
23
comment Correct way to truncate data to a range
@fgrieu Thank you. I was worried that I may have been over scrutinizing the graphs. I created the graph you suggested and I see the bias where some values are twice as likely to occur than others.
Apr
21
awarded  Commentator
Apr
21
comment Correct way to truncate data to a range
@fgrieu Do you mind looking at my distribution graphs? I ran the program twice to show that they are different each time. dropbox.com/s/iww8i5v0bucp7d4/rand_dist.pdf dropbox.com/s/d9g3e5s2v98q8nf/rand_dist2.pdf
Apr
21
comment Correct way to truncate data to a range
I skipped the middle man and opened /dev/urandom right in my program, and got the same result.
Apr
21
comment Correct way to truncate data to a range
@fgrieu What would be the correct way to read from /dev/random? I was just using dd and a pipe to send the data through stdin. The graph I'm am generating is the value of a number vs. the number of times it occurs.
Apr
19
comment Correct way to truncate data to a range
@fgrieu I am using /dev/random on Ubuntu linux. Graphing the input with no algorithm applied (finding the distribution from 0-255) yielded the same result.
Apr
19
comment Correct way to truncate data to a range
@fgrieu I graphed the distribution of the output and the result was a very "spiky" graph centered around some value. Is this what the distribution of random, uniformly distributed data should look like?
Apr
18
comment Correct way to truncate data to a range
@fgrieu Thank you for linking to that question. Since my range is so much smaller than 32 bits, what I gather from that question is that it would be best to truncate to 17 bits, and then reject all numbers out of my ranger?
Apr
18
comment Correct way to truncate data to a range
@Thomas I will try that, I think it will help me understand better.
Apr
15
comment Correct way to truncate data to a range
@fgrieu Could you please explain what the problem is, with the exception of the mod operator, with the first method?
Apr
15
comment Correct way to truncate data to a range
@fgrieu I see what you are saying about the bias from mod now, I hadn't considered that case. Is there a way to eliminate the most significant digit without creating a bias?
Apr
15
awarded  Editor
Apr
15
revised Correct way to truncate data to a range
Updated with import information regarding inputs and outputs
Apr
15
comment Correct way to truncate data to a range
@fgrieu That answer does look helpful, and I will read it but I would like to try and learn some more from your comments to this question. I just realized I left off what may have been a crucial piece of information, the input stream is trusted random. 1) Yes it should be uniformly distributed, why do the two algorithms fail this? 2). One output for every 32 bits. Each 32 bit block is not related to its neighbor in any way. 3) Assume now that neither computational or data efficiency are important.
Apr
15
asked Correct way to truncate data to a range