Help with Constraint

In reply to dave_59:

Thanks Dave.

I have one question :
Value is fixed here, can we write one line code to implement like this

000100100100…
0000000001001001001
so, randomly it should pick nth bit.