Randy Pausch, a Carnegie Mellon University computer-science professor, was about to give a lecture Tuesday afternoon, but before he said a word, he received a standing ovation from 400 students and colleagues.

He motioned to them to sit down. "Make me earn it," he said.

They had come to see him give what was billed as his "last lecture." This is a common title for talks on college campuses today. Schools such as Stanford and the University of Alabama have mounted "Last Lecture Series," in which top professors are asked to think deeply about what matters to them and to give hypothetical final talks. For the audience, the question to be mulled is this: What wisdom would we impart to the world if we knew it was our last chance?

It can be an intriguing hour, watching healthy professors consider their demise and ruminate over subjects dear to them. At the University of Northern Iowa, instructor Penny O'Connor recently titled her lecture "Get Over Yourself." At Cornell, Ellis Hanson, who teaches a course titled "Desire," spoke about sex and technology.

At Carnegie Mellon, however, Dr. Pausch's speech was more than just an academic exercise. The 46-year-old father of three has pancreatic cancer and expects to live for just a few months. His lecture, using images on a giant screen, turned out to be a rollicking and riveting journey through the lessons of his life.

He began by showing his CT scans, revealing 10 tumors on his liver. But after that, he talked about living. If anyone expected him to be morose, he said, "I'm sorry to disappoint you." He then dropped to the floor and did one-handed pushups.

Randy Pausch and his three children, ages 5, 2 and 1.

Clicking through photos of himself as a boy, he talked about his childhood dreams: to win giant stuffed animals at carnivals, to walk in zero gravity, to design Disney rides, to write a World Book entry. By adulthood, he had achieved each goal. As proof, he had students carry out all the huge stuffed animals he'd won in his life, which he gave to audience members. After all, he doesn't need them anymore.

He paid tribute to his techie background. "I've experienced a deathbed conversion," he said, smiling. "I just bought a Macintosh." Flashing his rejection letters on the screen, he talked about setbacks in his career, repeating: "Brick walls are there for a reason. They let us prove how badly we want things." He encouraged us to be patient with others. "Wait long enough, and people will surprise and impress you." After showing photos of his childhood bedroom, decorated with mathematical notations he'd drawn on the walls, he said: "If your kids want to paint their bedrooms, as a favor to me, let 'em do it."

While displaying photos of his bosses and students over the years, he said that helping others fulfill their dreams is even more fun than achieving your own. He talked of requiring his students to create videogames without sex and violence. "You'd be surprised how many 19-year-old boys run out of ideas when you take those possibilities away," he said, but they all rose to the challenge.

He also saluted his parents, who let him make his childhood bedroom his domain, even if his wall etchings hurt the home's resale value. He knew his mom was proud of him when he got his Ph.D, he said, despite how she'd introduce him: "This is my son. He's a doctor, but not the kind who helps people."

He then spoke about his legacy. Considered one of the nation's foremost teachers of videogame and virtual-reality technology, he helped develop "Alice," a Carnegie Mellon software project that allows people to easily create 3-D animations. It had one million downloads in the past year, and usage is expected to soar.

"Like Moses, I get to see the Promised Land, but I don't get to step foot in it," Dr. Pausch said. "That's OK. I will live on in Alice."

Many people have given last speeches without realizing it. The day before he was killed, Martin Luther King Jr. spoke prophetically: "Like anybody, I would like to live a long life. Longevity has its place." He talked of how he had seen the Promised Land, even though "I may not get there with you."

Dr. Pausch's lecture, in the same way, became a call to his colleagues and students to go on without him and do great things. But he was also addressing those closer to his heart.

Near the end of his talk, he had a cake brought out for his wife, whose birthday was the day before. As she cried and they embraced on stage, the audience sang "Happy Birthday," many wiping away their own tears.

Dr. Pausch's speech was taped so his children, ages 5, 2 and 1, can watch it when they're older. His last words in his last lecture were simple: "This was for my kids." Then those of us in the audience rose for one last standing ovation.

Write to Jeffrey Zaslow at jeffrey.zaslow@wsj.com