Sponsored Content
Top Forums Shell Programming and Scripting All possible combinations problem Post 302961530 by LMHmedchem on Monday 30th of November 2015 05:52:30 PM
Old 11-30-2015
Quote:
Originally Posted by wisecracker
Hi LMHmedchem...

You do realise that this 23 bit word would give 8388607 combinations if all bits were set to 1?!

Is this a possibility along with just any single random bit which would not have a subset at all...

Or am I missing something?
Yes, this is theoretically true. In my data, the most complex example has 11 bits set to 1. That is still quite a large number of combinations. There will never be a case with 0 on bits, but there will be some with 1 on bit that has no subsets as you point out.

It may be sufficient for me to analyze subesets up to some size, such as 5 on bits or something like that, I don't know yet.

At any rate, one of the reasons to use an automated algorithm is to be able to chew through very large numbers of permutations. At the end of the day, I need to compare the all possible subsets list to an actual list to see how many matches there are. The total number of matches will be very small, even if the list of possible matches is on the order of 10^7. I really don't care very much if this takes a long time to run (as long as it's not days), so I just have to get this automated so I can start looking at results.

LMHmedchem
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grepping number combinations

Having problem in using the grep command to select all possible combinations a number in a file. Example: 123, I would like to grep the numbers 123,132,213,231,312 and 321. (2 Replies)
Discussion started by: wperry
2 Replies

2. UNIX for Advanced & Expert Users

Combinations

Hello All, i have two files, one of the format A 123 B 124 C 234 D 345 And the other A 678 B 789 C 689 D 567 I would like to combine them into one file with three columns: A 123 678 B 124 789 C 234 689 (4 Replies)
Discussion started by: Khoomfire
4 Replies

3. UNIX for Advanced & Expert Users

All Shortcut key combinations

Hi, I am using the Korn-Shell (ksh) and would like to know all the shortcut keys. For example: Shift + Insert etc. Thank you very much. Take care (0 Replies)
Discussion started by: --crimson--
0 Replies

4. Shell Programming and Scripting

Generating Combinations

Hi, I need to generate all combinations upto n-1 level, if the input file looks like say, A B C D . . .... I need to generate all combinations such that first value remains constant and the remaning are combined with all possible ways. Output A AB AC AD ABC (1 Reply)
Discussion started by: zorg4u
1 Replies

5. Programming

series of combinations

HI I have a series(sorted), which i require to create combinations. I am not getting the good code for doing this. My series should generate the following combinations... Please help me in getting this in C++. Thanks for your help. A: A A B: A B A B A B C: A ... (1 Reply)
Discussion started by: rameshmelam
1 Replies

6. Linux

Help with color combinations

Hi Team when i do, echo on my host box it returns (see below) # echo $PS1 \$ I need to set a color comination of my own for \u means for user : red for \h means for hostname: blue for \W means present working directory: pink for $ means for wht prompt : yellow Do i need to... (1 Reply)
Discussion started by: whizkidash
1 Replies

7. Shell Programming and Scripting

Combinations / Permutations

Hello Scrutinizer / Group , The shell script of awk that Scrutinizer made calculate all possible permutations in this case 3125 (5 numbers) but i want to have only the 126 possible combination. For now it does not matter the specific order of the combination numbers. I would appreciate it you... (1 Reply)
Discussion started by: csierra
1 Replies

8. Programming

Words combinations without repetition

How can I get all combinations of 5 words from 10 words. For example I have 3 words and I want to get all combinations of 2 words. "A", "B", "C" it would like AB, BC, AC. Maybe you know some usefull code or example. Thanx a lot. P.S. Sorry if I'm not right enough cause I don't know English... (2 Replies)
Discussion started by: romeo5577
2 Replies

9. Shell Programming and Scripting

All possible combinations

Hi, I have an input file like this a b c d I want to print all possible combinations between these records in the following way aVSb aVSc aVSd bVSc bVSd cVSd VS indicates versus. All thoughts are appreciated. (5 Replies)
Discussion started by: jacobs.smith
5 Replies

10. Shell Programming and Scripting

awk permutations and combinations

hello, I'm reading this thread, in which there is this code :awk ' function comb(v,i) { for(i in A) { delete A; if(length(A)) comb((v?v"+":x)i) else print v"+"i A; } } { A } END { comb(); } ' infilebut I can't understand where does v come... (5 Replies)
Discussion started by: daPeach
5 Replies
drand48(3C)															       drand48(3C)

NAME
drand48(), erand48(), lrand48(), nrand48(), mrand48(), jrand48(), srand48(), seed48(), lcong48() - generate uniformly distributed pseudo- random numbers SYNOPSIS
Obsolescent Interfaces DESCRIPTION
This family of functions generates pseudo-random numbers using the well-known linear congruential algorithm and 48-bit integer arithmetic. In the following description, the formal mathematical notation [low,high) indicates an interval including low but not including high. and return nonnegative double-precision floating-point values uniformly distributed over the interval [0.0,1.0). and return nonnegative long integers uniformly distributed over the interval [0,2^31). and return signed long integers uniformly distributed over the interval [-2^31,2^31). and are initialization entry points, one of which should be invoked before either or is called. (Although it is not recommended practice, constant default initializer values are supplied automatically if or is called without a prior call to an initialization entry point.) and do not require an initialization entry point to be called first. All the routines work by generating a sequence of 48-bit integer values, X[i], according to the linear congruential formula X[n+1] = (a*X[n] + c) modulo m n>=0 The parameter m = 2^48; hence 48-bit integer arithmetic is performed. Unless has been invoked, the default multiplier value a and the default addend value c are given by a = 0x5DEECE66D (base 16) = 0273673163155 (base 8) c = 0xB (base 16) = 013 (base 8) The value returned by any of the functions or is computed by first generating the next 48-bit X[i] in the sequence. Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of X[i] and transformed into the returned value. The functions and store the last 48-bit X[i] generated in an internal buffer; that is why they must be initialized prior to being invoked. The functions and require the calling program to provide storage for the successive X[i] values in the array specified as an argument when the functions are invoked. That is why these routines do not have to be initialized; the calling program merely has to place the desired initial value of X[i] into the array and pass it as an argument. By using different arguments, and allow separate modules of a large pro- gram to generate several independent streams of pseudo-random numbers; i.e., the sequence of numbers in each stream do not depend upon how many times the routines have been called to generate numbers for the other streams. The initializer function sets the high-order 32 bits of X[i] to the 32 bits contained in its argument. The low-order 16 bits of X[i] are set to the arbitrary value 0x330E (base 16). The initializer function sets the value of X[i] to the 48-bit value specified in the argument array. In addition, the previous value of X[i] is copied into a 48-bit internal buffer, used only by and a pointer to this buffer is the value returned by This returned pointer, which can be ignored if not needed, is useful if a program is to be restarted from a given point at some future time; use the pointer to get at and store the last X[i] value, and then use this value to reinitialize via when the program is restarted. The initialization function allows the user to specify the initial X[i], the multiplier value a, and the addend value c. Argument array elements param[0-2] specify X[i], param[3-5] specify the multiplier a, and param[6] specifies the 16-bit addend c. After has been called, a subsequent call to either or restores the default multiplier and addend values for a and c, specified above. Obsolescent Interfaces generate uniformly distributed pseudo-random numbers. WARNINGS
and are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use and SEE ALSO
rand(3C), random(3M), thread_safety(5), random(7). STANDARDS CONFORMANCE
drand48(3C)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy