You and Knuth (and most others here) are operating under the same misunderstandings, the main one being a false equivalence between a patentable invention and the non-patentable underlying principles or elements that enable it. Let me just point to a previous comment that addresses this: https://news.ycombinator.com/item?id=7923894
Applying that to your example, note that a patent on "random ads" would not preempt anyone else from using shuffling algorithms, and hence it is not the algorithm being patented.
Applying that to your example, note that a patent on "random ads" would not preempt anyone else from using shuffling algorithms, and hence it is not the algorithm being patented.