hey guys i'm new at programming so i would like to know whats the steps required to solve to following question below. Thanks in advance!
Let a0,a1...an-1, b0,b1,...bn-1 be two distinct binary sequences. We say that a0,a1...an-1 is lexicographically smaller than b0,b1...bn-1 if ai = 0 and bi = 1 for the smallest index i for which
ai 6= bi. In other words, this means aj = bj for j < i, and ai = 0, bi = 1. The following are the
binary sequences of length 3 in increasing lexicographic order: 000, 001, 010, 011, 100, 101, 110,
111.
Given a binary sequence a0,a1....an-1, how to find the next binary sequence of length n in increasing lexicographic order? Let i be the index of the rightmost zero in a0,a1,an-1, i.e., the
largest i with ai = 0. Then the next sequence b0,b1,...bn-1 increasing lexicographic order is given
bj =
{ aj if j < i
1 if j = i
0 if j > i }
Hence the question is to write a C++ program that writes all binary sequences of length 15 in lexicographic order.