- Home /
How to create a list of all possible binary permutations with a given number zeros?
How to create a list of all possible binary permutations with a given length(4-8) and a given number of zeros? (I need to create lists with up to 8 digit sequences and without duplicates).
For example:
x = 2 (the number of zeros in the binary sequence)
l = 4 (length of the binary sequence)
The list: 0011 0101 0110 1001 1010 1100
I don't really know where to start. Any help would be appreciated.
You should start by looking into the algorithm to generate the permutations, then you worry about how to feed it the correct data so you get the output you want.
Here are a couple of links I found doing a quick google search:
https://stackoverflow.com/questions/15150147/all-permutations-of-a-list
https://stackoverflow.com/questions/104420/how-to-generate-all-permutations-of-a-list-in-python
Your answer
Follow this Question
Related Questions
Building our first application - Can't find binary 1 Answer
Serializing an Action as XML? 0 Answers
seperate binary retrieved from sql server 1 Answer
Binary data not finding path 2 Answers
Find the binary equivalent of a number 4 Answers