Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3290 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

From a production run I am trying to pull specific sequence based on the size of the run for quality control testing:

Example Function Parameters:

RunSelect ( quantity ; selection ) 

RunSelect ( 200 ; 2 ) 

The goal is to enumerate the list from 1 - 200 and then randomly choose a sequence number: Based on a random first 5 or last 5 so the result would be a random of 1-5 and between 196-200

Result:  3¶196

If the selection size was only 1 then it should choose randomly from the front or back of stack then choose a random from the that first or last set of five.

From a mathematical standpoint are these two essentially the same thing - picking a random item from:  1, 2, 3, 4, 5, 196,197,198, 199, 200 vs picking heads / tails then picking one from the five in the series?

I haven't yet written the function, wondering if someone has?

Thanks

 

 

Posted (edited)
1 hour ago, Ocean West said:

From a mathematical standpoint are these two essentially the same thing - picking a random item from:  1, 2, 3, 4, 5, 196,197,198, 199, 200 vs picking heads / tails then picking one from the five in the series?

(Edit) Ok, now I got it. No, there is no difference. In both cases, the probability of picking any one of the 10 numbers is 0.1.

 

1 hour ago, Ocean West said:

The goal is to enumerate the list from 1 - 200 and then randomly choose a sequence number:

If you are picking one item out of five, it doesn't matter what the five items are called. To pick two random items, one from the range of 1-5, and the other from 196-200, you can pick two random items from 1-5 and add 195 to the second one of these. There is no need to enumerate the entire range (or any range, for that matter).

Edited by comment
Posted

Thanks @comment regarding the odds. 

I already have a calculation to determine the number needed to pick based on the overall quantity. For every 100 items we pick 1 item for quality testing with a bit of rounding, if you have 130 items you' would pick one item either 1-5 or 126-130, if you had 200 items it would be 1-5 or 196-200. 

just trying to get a return value for the number to pick from either the front or back of the stack. 

This topic is 3290 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.