Struggling with switching Arduino and Random numbers

Reply #3 showed you how do do virtually the whole of your code in the loop so far in two lines.

You haven't fully understood what you want to do, if you have then you have not explainedit to us.
That code produces random flashes. Now what part does the input play? Just to say it changes the random patten dosn't make sense because it already is a random pattern therefore there will be no change.