in reply to sequence of positions to binary sequence

Course work? Length of 15 "bits"? Sure!
> perl -e ' @pos = (2,4,6,9); for $i (0..14) { print --$| and --$| or next if grep { $_ == $i } @pos; print $|; }' 001010100100000