Comment by Aurornis
It’s amazing how effective even a slight amount of random law enforcement can be.
Several of the hiking trails I frequent allow dogs but only on leash. Over time the number of dogs running around off leash grows until it’s nearly every dog you see.
When the city starts putting someone at the trailhead at random times to write tickets for people coming down the trail with off-leash dogs suddenly most dogs are back on leash again. Then they stop enforcing it and the number of off-leash dogs starts growing.
Random sampling over time is substantially as effective as having someone enforce the law 100% of the time. It's something like how randomized algorithms can be faster than their purely-deterministic counterparts, or how sampling a population is quite effective at finding population statistics.