By Dan Snierson
Updated June 12, 2014 at 06:30 PM EDT
  • TV Show
  • HBO

Warning: Spoilers — and math — follow!

In the climactic scene of Silicon Valley‘s season 1 finale, Richard (Thomas Middleditch) saves the day at the TechCrunch Disrupt competition by unveiling Pied Piper’s bold new compression algorithm, which earns a Weissman score heretofore unseen. But the boys really scored with the hotel-room scene before the big presentation, which begat one of the longest and finest dick jokes in TV history.

When Erlich (T.J. Miller) vows to his Pied Piper partners that “we’re going to win, even if I have to go into the auditorium and personally jerk off every guy in the audience,” Dinesh (Kumail Nanjiani), Gilfoye (Martin Starr), and Jared (Zach Woods) plunge down an R-rated rabbit hole and begin swapping hardcore equations and penile postulations while trying to figure out how they could possibly pleasure 800 guys in the 10-minute time alotted. All of this bawdy babble — which involves the straight-faced delivery of such terms as “mean jerk time” and “dick to floor” ratio — leads Richard toward his valuable company-rescuing epiphany.

It was an inspired moment for the series and one that co-creator Mike Judge had been trying to brainstorm since the beginning of the show. “From when we first got greenlit to series, I’d been saying that I want to find a moment like in A Beautiful Mindthe barroom scene about the girls and the guys — but funnier, that leads him to an epiphany,” he tells EW. “We hadn’t quite figured it out. One of the writers, Matteo Borghese, was not even talking about this scene, he was talking about a separate conversation — I think one of his roommates was talking about how you can jack off four guys at once, and Alec just said, ‘That’s it!’ I remember a lot of sessions in the writers’ room with me, Dan O’Keefe, Alec Berg, and Clay Tarver actually having these conversations, like, ‘Well, the real thing you’re looking for is dick to floor,’ and drawing all the stuff on the dry-erase board. A lot of the drawings on the dry-erase board I actually did. I’m really proud of that scene. There were some jokes, there were improv lines like, ‘Why are you pointing them at your face?’ and I ended up taking out anything other than them really trying to solve the problem. It seemed like the straighter they played it — they’re engineers trying to solve a problem — the funnier it was. We cut a lot of stuff out. Believe it or not, it was even longer.”

And believe it or not, you can learn much more about this gratifying process. Judge has tweeted a link to “Optimal Tip-to-Tip Efficiency: a model for male audience stimulation,” a 12-page academic paper in which Vinith Misra — a Stanford University graduate student in electrical engineering and one of the show’s technical consultants — details the most efficient way to sexually satisfy an auditorium full of men, all the way back through the cheap seats. (Misra is a student of Stanford Professor Tsachy Weissman, who also serves as a technical consultant, hence the show’s coining of the term “Weissman score.”) “Written” by Dinesh and Gilfoyle, Misra’s paper teems with hardcore math jargon delivered in a perfectly clinical tone. For example: “Every jerk action performed by the presenter transfers a quantity of gratification S(fs)T(ft) ∈ [0,1] to the audience member, where S (f) is the spatial gratification function and T (f) the temporal gratification function.” Good thing you paid attention in class, or that last sentence would totally fry your brain.

Judge was impressed by the level of detail and thought in the handiwork. “You can barely see it — it’s the thing that Kumail points to [on the dry-erase board] and says, ‘This is the best metric for stamina,'” he notes. “It’s actually a pretty interesting thing. There’s a constant based on your age, and there’s a separate graph for that, and then you plug that in this formula. I was looking at this graph and realizing — because it starts at infinity and goes down and your age is on the x axis — ‘Oh yeah, because when you’re a baby you can’t ejaculate!’ so then it starts to go up again. I was like, ‘Holy sh–, these Stanford math guys really paid a lot of attention to this!’ It’s a useful formula if you’re trying to jack off 800 guys.” For the rest of us, he cautions, “You’ll get way more math than you would want for something like this.”

And, by the way, Judge stands by the legitimacy of Richard having a “middle-out” breakthrough mid-discussion. “On one hand it’s fiction, but I went back and read about a lot of compression algorithms and learned a little bit about them in school,” he says. “But it really is left to right — the data flows through it. So, it’s very believable that somebody could have an epiphany about this… the same way that the true story of the guy in A Beautiful Mind had that epiphany based on this real-life thing.” Whether your mind is beautiful or dirty, expand it by perusing this provocative paper.

Episode Recaps

Silicon Valley

  • TV Show
  • 5
  • In Season
  • Mike Judge
  • HBO
stream service