|
|
|
#1
|
|||
|
|||
|
Random Number Generation Question
We have a procedure for testing samples by assigning numbers and then testing the sample number randomly generated.
Now the process for assigning and generating numbers is very long for each number. If we have 20 samples we end up testing 16. So to save 5 minutes I randomly generate the numbers for the 4 I'm not testing. My boss hates when I do this since it isn't SOP, but doesn't make me change the way I do it, rather just complains. Is the probability math different by negatively selecting instead of positively selecting the random numbers? |
| Advertisements | |
|
|
|
|
#2
|
|||
|
|||
|
Do you mean that you have samples numbered 1 thru 20, then pick 4 of those numbers at random as the ones to exclude, rather than picking 16 of those 20 as the ones to include? If so, there is no difference; the 16 tested samples are just as random for each method.
Now, if the random number generator is slightly biased--say, for example, it produces the number X at a higher-than-expected rate than pure chance--I wonder which method would be better? My instinct says choosing only four numbers would be better because it's fewer opportunities for the bias to occur, but that's just a guess |
|
#3
|
|||
|
|||
|
Quote:
Quote:
Thanks this is what I thought, and once I do the math for my boss, I get a free lunch. I just wanted to double check before opening my mouth. |
|
#4
|
|||
|
|||
|
Purely random is probably not true, that's almost impossible to accieve.
|
|
#5
|
|||
|
|||
|
If you want to express it mathematically, the statement you're looking for is that (20 choose 4) = (20 choose 16).
|
|
#6
|
|||
|
|||
|
Quote:
Something tells me you're not rolling a 20-sided die. |
|
#7
|
|||
|
|||
|
To amplify a bit, "Number of ways Y objects can be chosen from X objects"--written here as "(X choose Y)"--can be shown to be X!/[Y!(X-Y)!] (X! = "X factorial" = 1*2*3*...*(X-1)*X). With that formula, it's easy to see the equality.
|
|
#8
|
|||
|
|||
|
Quote:
Quote:
So thanks to you wonderful people, I now have an extra hour of my day not filling in boxes with control numbers. Thank-you! |
|
#9
|
|||
|
|||
|
Quote:
(FWIW ... random.org doesn't use an equation. Their numbers come from sampling noisy physical systems.) |
|
#10
|
|||
|
|||
|
Quote:
Last edited by Dr. Love; 05-22-2012 at 05:07 PM. |
|
#11
|
|||
|
|||
|
That depends on how you're generating numbers. Trying to get 16 unique results in a row with a D20 might take a while.
|
|
#12
|
|||
|
|||
|
Quote:
|
|
#13
|
|||
|
|||
|
Quote:
Quote:
)
|
|
#14
|
|||
|
|||
|
It's easier to understand the equality just from the observation in the OP... if you choose a set of objects to include, that amounts to a corresponding choice of objects to exclude.
Last edited by Indistinguishable; 05-22-2012 at 05:45 PM. |
|
#15
|
|||
|
|||
|
Quote:
Assuming that the Official Corporate Random Number Generator can be set to spit out a number between 1 and 4845, the OP could create a look-up table with all the ways to pick 16 things from 20, and ask the OCRNG to generate an index into the table. Then he only needs to file the paperwork for one random number instead of four. Of course his boss's head would probably explode ... . |
|
#16
|
|||
|
|||
|
It wouldn't take much. You should've seen the emails that went back and forth between department heads when it was discovered that I was helping an intern with homework by doing Bradford assays (for those that never took a biochemistry class, its a method that is probably only done in classrooms now, and has been around forever) in our lab. His problem wasn't me actually fucking around on-the-clock, but that we were following the professors procedure, instead of the company dictated way to do things.
Other then that he is a really nice guy, but very old school with how he does stuff. |
|
#17
|
|||
|
|||
|
Just curious - what is the rationale behind excluding 4 samples out of 20 from the test, as opposed to excluding 10 or 15? It does not seem like you save that much time compared to just testing all of them, nor gain all that much certainty compared to testing a smaller subset.
Last edited by Absolute; 05-22-2012 at 07:12 PM. |
|
#18
|
|||
|
|||
|
Quote:
|
|
#19
|
|||
|
|||
|
Quote:
|
|
#20
|
|||
|
|||
|
#21
|
|||
|
|||
|
I did this in the 70's
All random generators need a seed number. I use the voltage coming into the power supply on a server.
Say it is 230 volts. It is really 230.XXXXXX volts. That XXXXXX constantly changes in microseconds. Use the decimal ( or part of it) as the seed number and that is about as random as you can get as it changes every moment. |
|
#22
|
|||
|
|||
|
Quote:
|
|
#23
|
|||
|
|||
|
It depends on how much entropy you need, and how quickly you burn through it. You can also get entropy from user input devices like keyboards and mice, or from a microphone, or from the least-significant bits of the processor temperature, all things which the typical computer has access to. If you really want to get serious about it, you get a special piece of hardware that has a sample of some radioactive material in it, and use the timing of the decays to generate entropy.
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|