Ask Your Question

# Revision history [back]

### Combination under constrained situation with a condition

Is their any some one can help me say

step 1: I want to take a number n as input from user

step 2: We from the set S consisting of elements from 0 to n*(2^{n-1})

step 3: Now I pick have to all possible 2 element sets of S say from it and store it in "P"

step 4: Now i need to pick n*(2^{n-1}) 2 element sets from P such that each number that occurs in that set occurs exactly n times neither less nor more and put them all in a list

Example n=2 n(2^{n-1})=22^{2-1}=4 S={0,1,2,3,4} p={(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}

step 4 one element which satieties condition of step 4 HERE n=2 {(0,1),(1,2),(2,3),(0,3)} which has 2* 2^{n-1}=2*2^{2-1}=4 elements

Now see in the above set 0 occurred n=2 times only in (0,1) and (0,3) only 1 occurred n=2 times only in (0,1) and (1,2) only 2 occurred n=2 times only in (1,2) and (2,3) only 3 occurred n=2 times only in (2,3) and (0,3) only

Similarly we may get for {(0,1),(1,4),(4,2),(2,0)} we can easily verify like above

Now based on n the number of elements size etc will vary

kind help if possible any one

### Combination under constrained situation with a condition

Is their any some one can help me say

step 1: I want to take a number n as input from user

step 2: We from the set S consisting of elements from 0 to n*(2^{n-1})

step 3: Now I pick have to all possible 2 element sets of S say from it and store it in "P"

step 4: Now i need to pick n*(2^{n-1}) 2 element sets from P such that each number that occurs in that set occurs exactly n times neither less nor more and put them all in a list

Example n=2 n(2^{n-1})=22^{2-1}=4 (2^{2-1})=4 S={0,1,2,3,4} p={(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}

step 4 one element which satieties condition of step 4 HERE n=2 {(0,1),(1,2),(2,3),(0,3)} which has 2* 2^{n-1}=2*2^{2-1}=4 (2^{n-1})=2*(2^{2-1})=4 elements

Now see in the above set 0 occurred n=2 times only in (0,1) and (0,3) only 1 occurred n=2 times only in (0,1) and (1,2) only 2 occurred n=2 times only in (1,2) and (2,3) only 3 occurred n=2 times only in (2,3) and (0,3) only

Similarly we may get for {(0,1),(1,4),(4,2),(2,0)} we can easily verify like above

Now based on n the number of elements size etc will vary

kind help if possible any one

### Combination under constrained situation with a condition

Is their any some one can help me say

step 1: I want to take a number n as input from user

step 2: We from the set S consisting of elements from 0 to n*(2^{n-1})

step 3: Now I pick have to all possible 2 element sets of S say from it and store it in "P"

step 4: Now i need to pick n*(2^{n-1}) 2 element sets from P such that each number that occurs in that set occurs exactly n times neither less nor more and put them all in a list

Example n=2 n(2^{n-1})=2(2^{2-1})=4 S={0,1,2,3,4} p={(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}

step 4 one element which satieties condition of step 4 HERE n=2 n=2

{(0,1),(1,2),(2,3),(0,3)} which has 2* (2^{n-1})=2*(2^{2-1})=4 elements

Now see in the above set 0 occurred n=2 times only in (0,1) and (0,3) only 1 occurred n=2 times only in (0,1) and (1,2) only 2 occurred n=2 times only in (1,2) and (2,3) only 3 occurred n=2 times only in (2,3) and (0,3) only

Similarly we may get for {(0,1),(1,4),(4,2),(2,0)} we can easily verify like above

Now based on n the number of elements size etc will vary

kind help if possible any one 4 None

### Combination under constrained situation with a condition

Is their any some one can help me say

step Step 1: I want to take a number n n as input from user

step Step 2: We from form the set S S consisting of elements from 0 0 to n*(2^{n-1})

step n*(2^{n-1})

Step 3: Now I pick have to all each possible 2 element sets two-element subsets of S say from it S and store it in "P"

step P.

Step 4: Now i I need to pick n*(2^{n-1}) 2 element sets n*(2^{n-1}) two-element subsets from P P such that each number that occurs in that set occurs exactly n times n times neither less nor more and put them all in a list

Example n=2 n(2^{n-1})=2(2^{2-1})=4 S={0,1,2,3,4} p={(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}

step list.

Example

n = 2
n*(2^{n-1}) = 2*(2^{2-1}) = 4
one S = {0,1,2,3,4}
p = {(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}


Step 4 One element which satieties satisfies condition of step 4 4; HERE n=2

{(0,1),(1,2),(2,3),(0,3)} n = 2.

{(0,1),(1,2),(2,3),(0,3)} which has 2* (2^{n-1})=2*(2^{2-1})=4 elements2*(2^{n-1}) = 2*(2^{2-1}) = 4 elements.

Now see in the above set 0 set

• 0 occurred n=2 n=2 times only in (0,1) and (0,3) only 1 (0,1) and (0,3) only
• 1 occurred n=2 n=2 times only in (0,1) and (1,2) only 2 (0,1) and (1,2) only
• 2 occurred n=2 n=2 times only in (1,2) and (2,3) only 3 (1,2) and (2,3) only
• 3 occurred n=2 n=2 times only in (2,3) and (0,3) (2,3) and (0,3) only

Similarly we may get for {(0,1),(1,4),(4,2),(2,0)} {(0,1),(1,4),(4,2),(2,0)} we can easily verify like aboveabove.

Now based on n n the number of elements size etc will vary

kind vary.

Kindly help if possible any oneone.