On a beautiful sunny morning , 939 undergraduates and 1,545 graduate students received their MIT diplomas today after hearing an address by Sal Khan ’98, MEng ’98, founder of the online Khan Academy, that elicited gales of laughter while also providing thought-provoking advice.MIT President Susan Hockfield told the graduates that she has more in common with this year’s class than with previous ones: She too, she said, will be moving on after nearly eight years as the Institute’s leader. Hockfield, who will be succeeded as president by Provost L. Rafael Reif on July 2, said, “All of us likely look forward to commencing our next chapter with a sense of breathless excitement.”Among the lessons Hockfield said she has learned at the Institute: “Every day, MIT faculty, students, postdocs, staff and alumni take a sharp look at the way things are — and find a way to make them better.” One sterling example of that, she said, is Khan, who has created “a brand-new catalyst for transforming how, when and how well everyone learns everywhere, online.”In introducing Khan, John Reed ’61, SM ’65, chairman of the MIT Corporation, pointed out that this was not Khan’s first appearance before Killian Court: As president of his senior class, Khan spoke at Commencement in 1998, saying then that “it is no exaggeration to say that we will change the world.”Reed added: “Having checked this assignment off his to-do list, he joins us here today.”Khan said that his experience at MIT has “played a much deeper role than many of you might appreciate” in his own life. He was proud of his alma mater, he said, when hearing of its plans a decade ago to launch MIT OpenCourseWare , making course materials available to anyone in the world for free — and more recently with the announcement of edX , a partnership with Harvard University that will carry that concept of free access to top-level higher education even further. While other institutions were looking for ways to profit from, or defend against, online education, MIT opted for free and open access — “to put principle over profit,” as Khan put it.That model, he said, “in no small way inspired what has now become the Khan Academy ,” which offers thousands of free educational videos aimed at elementary and high school students.Khan compared MIT to the fictional Hogwarts school in the bestselling Harry Potterseries. “The ideas and the research and the science that percolates behind these walls, that’s the closest thing to magic in the real world,” he said. “Frankly, to people outside this campus, it looks like magic.”Khan described the MIT faculty as “the leading wizards of our time, the Dumbledores and McGonagalls,” he said, referring to Harry Potter’s fictional teachers of wizardry.Coming back to MIT, Khan said, felt like returning to a close family. MIT students all share “that same core desire to understand the universe … to push humanity forward,” he said. Faced with the demands of a curriculum that pushes them to their limits, he said, “you cry together, you laugh together, you procrastinate together, you have sleepless nights together,” resulting in “the deepest possible bonds” — which Khan compared to those of soldiers who have ventured through combat together.Khan urged the graduates, as they face life, to try to be “as incredibly, and maybe delusionally, positive as possible,” and to force themselves to smile “with every atom of your body,” even in difficult times.Before they set out into the world, Khan asked the Class of 2012 to carry out a “thought experiment.” He urged them to imagine themselves 50 years from now, reflecting back on their lives, and thinking about the things they might have wished to do differently: spending more time with family members, or expressing their love more openly to those they care about.But then imagine, Khan said, that a genie appears and gives them the chance to travel back those 50 years, and find themselves back again at Commencement — with a second chance to realize that “I can laugh more, I can sing more, I can dance more, I can be more of a source of positivity for the people around me, and empower more people.”As they embark on this imagined “second chance,” Khan said, he was “just in awe of the potential that’s here.” Addressing the graduates as “the wizards of tomorrow,” he said, “I’m just excited to see what you’re going to do with your second pass.”Hockfield, in her charge to the students, thanked the Class of 2012 for its class gift of $20,000, which will be used to fund special projects and trips by student clubs and organizations. More than 80 percent of the class contributed, she said, noting that this was, “by an enormously wide margin, the highest participation in the history of MIT.”“I know you will leave here with the deep imprint of this community’s profound commitment to service,” Hockfield said. “Now is the moment for us to send you forth … to put MIT’s spirit and principles to work around the globe.”