Problem 1488. Generate binary combinations for a given number of bit(s)
Generate the binary combination as in the example below.
Example: If you are given:
bin_comb(2)
The answer will be:
0 0 0 1 1 0 1 1
The answer will appear in double class.
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
andrea84
on 5 May 2013
test case 1 should be [0;1] ?
Ned Gulley
on 6 May 2013
I cleaned up the problem statement and fixed the first test.
Claudio Gelmi
on 7 May 2013
Thanks!
Solution Comments
Show commentsGroup

Combinatorics II
- 15 Problems
- 23 Finishers
- Path of least resistance
- Path of least resistance - Move all direction
- Number of paths on a grid
- Number of paths on a 3d grid
- Number of paths on a n-dimensional grid
- Which way to go?
- How many rectangles in a grid ?
- The Number of Ways
- possible ways through matrix
- Yet Another Path Finder
- Find the path through the cell
- Project Euler: Problem 18, Maximum path sum I
- Break it up! Break it up!
- Number of cyles and fixed points in a permutation
- Generate binary combinations for a given number of bit(s)
Problem Recent Solvers94
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!