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)

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


----- Original Message -----
From: Bill Reger <billr@xxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
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.)


This thread ...


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