THERE IS A SAYING about how if you have an infinite number of monkeys jumping across the keys of an infinite number of typewriters, sooner or later you will get Hamlet. It is probably the same principle that accounts for the fact that at long last the Moral Majority and I are in agreement on something -- a television boycott. It had to happen sooner or later.

It is the position of the Rev. Jerry Falwell, president of the Moral Majority, that network television is a veritable cesspool of sex, violence and (knock on wood) more sex. His remedy for this is to propose a boycott whereby the people who are offended by what they see on television will not buy the products advertised thereon.

To this the networks cry censorship. They are against all kinds of censorship (unless it is their own) and in this they are supported by a bevy of civil libertarians. They, too, fear censorship, and wonder about the standards by which Mr. Falwell and his associates in the purity biz would judge what is dirty and what is violent.

Here the critics have a point. Falwell referred in a recent article in Advertising Age to the show "Dallas." He considers it dirty, and of course he is right. This is precisely why so many people like it so much. But while the Moral Majority is exercised about sex, it does not get particularly upset about sexism or sexual stereotyping and there are even some who think that Falwell does not have his heart in the fight against television violence.

The National Coalition on Television Violence, which has a tendency to quantify everything, is one of the suspicious ones.It scrutinized the newsletter put out by the Moral Majority's ally, The National Federation for Decency, and found that only 4 percent of it was devoted to the violence issue, while 60 percent went to sex and another 36 percent to drugs. In fact, the programs cited as "unconstructive" were precisely those that were low in violence, like "Taxi," but frank and adult when it came to sex. Falwell would, I'm sure, use different terms to describe that program. Even on television, sex remains subjective.

Violence is a different matter. Here, the results are easier to measure. It takes no great genius to figure out that if a teen-age gang commits the very same crime that was depicted on television the night before, that the idea came from television. No one is saying that this sort of thing happens frequently or even that it happens occasionally. It just happens sometimes and that is enough. There would be people alive today if there had not been certain shows on television.

Similarly, it is just as clear that routine television violence tends to make violence seem just that -- routine. A whole generation of kids grow up thinking that hitting people is commonplace -- that it is, say, a proper response to an improper comment or that it has no real consequences. In real life, people get hurt when hit -- sometimes seriously hurt.

This is so apparent that even a network executive could figure it out. But a network executive knows that what sells on television, when imagination and talent give out, is sex and violence. Since it sells, the only way to mitigate it or get rid of it, is to make certain that the products sponsoring the show do not sell. You accomplish this by not buying those products.

This is what Falwell proposes. It is called a boycott and that is not the same as censorship. Censorship is something the government does and at its most insidious it involves political ideas, not an attempt to boost the ratings with a bit more smut. We have a right not to buy what we don't want to buy. This is what a whole lot of people did with California table grapes and, later, luttuce, as a way of supporting the farm workers union.

To hold companies responsible for the programs they sponsor or their commercials is not all that different from holding them accountable for their labor policies or their political principles. It is a way of expressing dissent, of putting your money where your mouth is.That's all that Jerry Falwell wants to do and there is nothing wrong with that. On that the celebrated television preacher and I agree, but I think we would disagree about the television product I most would like to boycott: The Moral Majority.