Can I Create a Pattern with Alternating 1's and 0's in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter Sarah rob
  • Start date Start date
  • Tags Tags
    Generator Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
Sarah rob
Messages
16
Reaction score
0
I am using
co = 0;
co++
If[Mod[co, 20, 1] > 10, 1, 0];
which is used in an iterative function
which produces 10 1' s 10 0' s, 10 1' s 10 0' s and so on ...
Could I use a similar method to produce 10 1' s then 5 0' s, 10 1's 5 0' s and so on...
 
Physics news on Phys.org
co = 5;co++;If[Mod[co, 20, 1] > 5, 1, 0]