## Combination of 6 nos

Combination of 6 nos
# 1
02-24-2016
Combination of 6 nos

Hi folks,

I have a numbers from 1-100 and from these nos I have 30 numbers.. From this 30 nos, I have to generate a combination of 6 nos... this 30 numbers will range from 1-100... ( FYI: This is not a lottery game - just kidding) ... I am trying out this in a shell script.. any ideas ?
 gsiva View Public Profile for gsiva Find all posts by gsiva
# 2
02-24-2016

How about using a random number as the index into the array[100]?
 RudiC View Public Profile for RudiC Find all posts by RudiC
# 3
02-24-2016
As an addendum to RudiC's reply remember to allow for any duplicate numbers in generating the array _randomly_.

Once you have the array then randomly select your 6 numbers from the array of 30 numbers, again checking for possible duplicates...
 wisecracker View Public Profile for wisecracker Find all posts by wisecracker
# 4
02-25-2016
There is a way to create an array of a range of random numbers with each one occurring once with no duplicates.
1. Populate the first array with all possible values, call it "deck".
2. Varying a (loop ) subscript from last occurrence to first, get a random number, multiply it by that subscript, and floor it to get a new subscript.
3. Use the new subscript to move an item from "deck" to the loop subscript occurrence of the array "shuffle".
4. Move the last active occurrence of "deck" (looping subscript) to the new subscript occurrence of deck.
When the last occurrence of deck is chosen, the last item in "deck" will be moved to its own position but, because the looping subscript is decreasing, it will never be referred to again. The array "shuffle" is now ready to use.
If the same occurrence of "deck" is chosen again, it will contain a new value.
 wbport View Public Profile for wbport Visit wbport's homepage! Find all posts by wbport

## Kill -9 -1 combination

Good morning, In a Production environment ive seen this command that kills processes kill -9 -1 Because i am in a production environmet i can not execute this comamnd, so i would like to know what is the difference for the conventional kill -9 PID ? Thanks a lot

## 6 digits combination

Is there any program that can create 6 digit numbers with: (DIGIT_1)+(DIGIT_2)+(DIGIT_3)+(DIGIT_4)+(DIGIT_5)+(DIGIT_6)=10 Any perl or C also can. Anyone can help me? Thank you

## New sequence nos to be added in new files

Hi All, Please help me in below request. Got multiple files in a dir ex: /os . from each file need to filter based upon first field (field only has 1,2,3 or 4) and then put it in different files based on the Field 1. But need to generate a sequence while inserting and the sequence number needs...

## Combination of numbers

Hello Group, I have a file of data that contain 1 2 3 4 5 I request you help with a shell script for generate all posible combination of these numbers with the following output: Example: 1 + 2 + 3 + 4 + 5 = 2 + 2 + 3 + 4 + 5 = 3 + 2 + 3 + 4 + 5 = Thanks in advance. Carlos

## Escape and combination

Hi I have 2 files like: file1 a 12 b 1 a 3 file2 a 9 c 0 a 8 and i would like to get a 12 a 9 a 3 a 8 i can do it with grep and paste with 3 lines. I tried to combine using:

## Delete repeated nos in a file

Hi, I need to delete repeated nos in a file and finally list the count. Can some one assist me? file: 12345 12345 56345 12345 23896 Output needed: 12345 56345 23896 Total count:3 Thanks

## combination of two commands

I want to show a output like this Lee Ballancore PID TTY TIME CMD 31799 pts/3 00:00:00 vim 31866 pts/3 00:00:00 vim 2495 pts/7 00:00:00 vim 8368 pts/0 00:00:00 vim 9544 pts/2 00:00:00 ps Alistairr Rutherford PID TTY TIME CMD 8368 pts/0 00:00:00 vim 9544 pts/2 00:00:00 ps ...

## Combination Of commands

Hello All, I just wanted to know what are the different ways of using commands in combination. The most common one which i know is using pipes. Also grouping is also done like ( ls; date) where output of both the commands is displayed. Are there any other ways of combining various...

## Partition combination

Hi all I've got MacOSX server which is a UNIX based system. I've got 2 partiontion an I like to make just one partition on he disk without loosing any data on part1. Is there a way to do that kind of thing in UNIX or do I have to format everything and put up the system again? Thanx for reading...