# How to multiply out the same lists [closed]

If I have a list of the following form:

{1,1,1,0,1,1,1}


How can I create a list containing 5 of these lists ie:

{{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1}}


## closed as off-topic by C. E., Bob Hanlon, eyorble, Michael E2, Henrik SchumacherDec 10 '18 at 21:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – C. E., Bob Hanlon, eyorble, Michael E2, Henrik Schumacher
If this question can be reworded to fit the rules in the help center, please edit the question.

• e.g. ConstantArray[{1, 1, 1, 0, 1, 1, 1}, 5], Table would do the same thing. – C. E. Dec 8 '18 at 19:41
• Yep, was about to post that as an answer. Got me first. – Titus Dec 8 '18 at 19:43
• Ok for example, I want to generate 5 lists of random 0s and 1s, each of length 10: – beemen Dec 8 '18 at 19:52
• If the five are identical then ConstantArray[RandomInteger[1, 10], 5]; if each is random then RandomInteger[1, {5, 10}] – Bob Hanlon Dec 8 '18 at 20:08

Besides ConstantArray and Table, one can use KroneckerProduct as well

vector = {1, 1, 1, 0, 1, 1, 1};
KroneckerProduct[{1, 1, 1, 1, 1}, vector]


Try this:

Table[a, 5] /. a :> {1, 1, 1, 0, 1, 1, 1}

(* {{1, 1, 1, 0, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1}, {1, 1, 1, 0, 1, 1,
1}, {1, 1, 1, 0, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1}}  *)


Have fun!