Last year when Andrew Ng, a computer science professor at Stanford University, put his machine-learning class online and opened enrollment to the world, more than 100,000 students signed up.

"I think all of us were surprised," he says.

Ng had posted lectures online before, but this class was different.

"This was actually a class where you can participate as a student and get homework and assessments," he said.