“Mr. Miranda, at an airport on his way to a vacation with his wife in Mexico, picked up a copy of ‘Alexander Hamilton,’ a 2004 biography by Ron Chernow. By the second chapter, Mr. Miranda thought the story was made for hip-hop: Hamilton, an orphaned immigrant, plays a key role both in the American Revolution and in the nation’s foundational years, only to stumble with a sex scandal and to die in a duel. Hamilton’s childhood, Mr. Miranda said, made him think of Jay Z’s early days in the Marcy Houses in Brooklyn, and Eminem’s upbringing in Detroit.”