THE L WORD: GENERATION Q 10 p.m. on Showtime. It’s been more than 10 years since “The L Word,” Showtime’s groundbreaking series about lesbian life in West Hollywood, went off the air. Now, a new cast representing a younger, more diverse and more fluid group of L.G.B.T.Q. characters has been tapped for a revival. “Generation Q” also stars the original cast members Jennifer Beals, Leisha Hailey and Katherine Moennig.

SILICON VALLEY 10 p.m. on HBO. The Pied Piper gang signs off for the final episode of this sendup of the Bay Area’s tech gold rush. Writing about the sixth season for The New York Times, Farhad Manjoo points out that the show has grown over time to acknowledge the gloominess of the tech industry by asking: “Can good coexist with greed? Is it O.K. to act unethically in the service of ethical ends? Does money necessarily ruin everything — and how much does that matter, if we’re talking billions?” But as the series approaches its finale, Manjoo writes, “I’d rather Richard and the gang fail honorably, letting Pied Piper die, than succeed by selling out. But that, too, would be unreal.”

MADAM SECRETARY 10:30 p.m. on CBS. From Secretary of State to the Oval Office, Elizabeth McCord (Téa Leoni) has governed with honor, intelligence and candor. Now, in the show’s series finale, President McCord will embark on a new political initiative with help from members of the World Cup champion United States women’s soccer team, while also trying to plan a family celebration.