How to apply material to disjointed object duplicated with array modifier
When dealing with the Array Modifier it's important to know that object coordinates (which you are using) are generated for the whole object, but the 0-1 texture space is matched to the un-arrayed object. If you were using UVs, the UV map would repeat on each tile, which is even less of what you want in the long run. So your approach is the right one, but instead of having UV coordinates between 0 and 1, you have them between 0 and 7, because you need 7 tiles to fill the space. That makes the texture repeat again on your tiles.

Luckily the solution in your case is simple: Plug a Mapping node right after you generate the random coordinates, and set the scale to 1/7 (or if you change the number of tiles later, fill in the numOfTiles respectively). Blender will do the math for you. Voila: The coordinates have been transferred back to 0-1 space:



You can check the modified Blend file here: