Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

sequence number from population

Featured Replies

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

 

 

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

  • Author

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. 

  • Author

probably not perfect but seems to work - 

 

I am afraid I am unable to follow the logic.

Edited by comment

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.