Determining Combinations with Restraints

So the number of unique color permutations in this scenario would be 2^n/2. In summary, there are 2^n/2 unique color permutations possible in this scenario.
  • #1
Altermeris
3
0
I'm loosely familiar with the formulas for combinations and permutations. However, I don't know how to use the formula with restraints.

Here is the specific issue I am having:

Number of Objects: 16
Number of States: 2
Number of Black Objects 8
Number of White Objects: 8

How many unique permutations color permutations are possible?​
I know that for the first and last 8 both have 2^8 permutations, so there is a minimum of 512 permutations.
 
Mathematics news on Phys.org
  • #2
I'm sorry, I don't understand the question.
 
  • #3
Hey Altermeris and welcome to the forums.

Your question is unclear but one recommendation to make it clearer is to write the scenarios and then write how many states per scenario.

For example 2 states per object for 16 objects is 32 states, or 2 states per combination of every pair of objects selected without replacemet is 2*16*15 = 480 or 512 if with replacement.

This kind of thing would be a lot more informative and cause less confusion.
 
  • #4
I wrote a brute force program to solve the problem. By punching in the output of the brute forcing algorithm into WolframAlpha, I was able to find the sequence formula to solve this problem.

An=C(2n,n)

Code:
public class BruteForcePermutation {
    
    public static boolean countUniqueChar(int num, char symb, String text){
        int count = 0;
        int textLength = text.length();
        char[] charArray = new char[textLength];
        
        charArray = text.toCharArray();
        
        for(int i = 0; i<textLength; i++)
            if(charArray[i]==symb)count++;
        
        if(count==num) return true;
        else return false;   
    }
    
    public static String intToBinary(int num, int size){
        String result = "";
        
        while(num!=0){
            result = (num%2) + result;
            num /= 2;
            size--;
        }
        
        while(size>0){
            result = "0" + result;
            size--;
        }
        
        return result;
    }
    
    public static void main(String[] args){
        String currentBin = "";
        int permutations;
        
        int terms = 10;
        for(int size = 2; size<=terms*2;size+=2){
            permutations = 0;
            for(int i = 0; i<Math.pow(2,size) ;i++){
                currentBin = intToBinary(i,size);
                if(countUniqueChar((size/2),'1',currentBin)){
                    //System.out.println(currentBin);
                    permutations++;
                }
            }
        System.out.print(permutations + " ");
        }
    }
}

I was working on this problem in particular in hope of creating a more efficient algorithm for a pathing problem.
 
  • #5
OK, so have you solved the problem to your satisfaction? If not, then could you please post a better description of your problem, because I don't want to read through Java to try to figure out what you mean.
 
  • #6
Robert1986 said:
OK, so have you solved the problem to your satisfaction? If not, then could you please post a better description of your problem, because I don't want to read through Java to try to figure out what you mean.

I am still unsure about how to determine the formula by observation.

I'll try describing the problem differently.

If you have a bag of n-Coins that contain (n/2) black coins and (n/2) white coins, how many ways can you place the white and black coins in a line of n?
 
  • #7
Altermeris said:
I am still unsure about how to determine the formula by observation.

I'll try describing the problem differently.

If you have a bag of n-Coins that contain (n/2) black coins and (n/2) white coins, how many ways can you place the white and black coins in a line of n?
[tex]\binom{n}{n/2}[/tex]
the number of combinations of n objects taken n/2 at a time.
 

Related to Determining Combinations with Restraints

1. What is the purpose of determining combinations with restraints?

The purpose of determining combinations with restraints is to calculate the number of possible ways to arrange a set of items or elements, while also taking into account certain limitations or conditions that must be met.

2. How do you determine the number of combinations with restraints?

To determine the number of combinations with restraints, you need to first identify the total number of items or elements in the set, as well as the number of items that must be chosen or included in each combination. Then, you can use the formula nCr = n! / (r! * (n-r)!) to calculate the number of combinations, where n represents the total number of items and r represents the number of items in each combination.

3. What are some common types of restraints that may affect combinations?

Some common types of restraints that may affect combinations include a limited number of choices, a specific order in which items must be arranged, or a requirement that certain items must be included or excluded in a combination.

4. Can restraints ever increase the number of possible combinations?

No, restraints can never increase the number of possible combinations. They can only limit or restrict the number of combinations that are possible.

5. How can determining combinations with restraints be applied in real-life situations?

Determining combinations with restraints can be applied in various real-life situations, such as in genetics to calculate the possible combinations of genes in offspring, in sports to determine the possible team formations, or in business to plan product variations or menu options.

Similar threads

  • General Math
Replies
1
Views
796
  • General Math
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
714
  • General Math
Replies
1
Views
1K
  • Math Proof Training and Practice
Replies
23
Views
949
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
945
  • Precalculus Mathematics Homework Help
Replies
32
Views
1K
Replies
1
Views
2K
Back
Top