MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » January 2013

Re: Random selection of 10%



fixed

You'll need a random number generator that returns a number based on "from" and "to" parameters.

Do you know the total number of "cases" per day? Can you identify each one sequentially? Do you need to generate a list of case sequence numbers?

total_cases = 100;
inspect_cases = total_cases / 10;

for i = 1 to inspect_cases;
 inspect_this = random(1:total_cases);
 (store inspect_this somewhere)
endfor;

If your random() function ever returns a duplicate value, you'll need to discard it and decrement "i".

-Nathan
 


----- Original Message -----
From: Bill Reger <billr@xxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Cc:
Sent: Wednesday, January 30, 2013 9:09 AM
Subject: Random selection of 10%

We would like to audit 10% of the Cases that flow down the shipping
conveyor - checking that the contents of the Case matched what was
(supposedly) packed.

Now obviously we could count each Case and pull every 10th Case for audit.
But it would not take long for someone to figure this out - and if they
were so inclined - only short Cases other than the 10th in line.

Is there an algorithm/logic that we could employ to randomly pull Cases
that would equate to 10% over the course of a day but not be every 10th
Case?  (My logic brain is on strike today and I can't think of a way to
design this.)

Bill





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact