A new curriculum that helps children understand how algorithms are designed will keep them safe and motivate them to help shape the technology’s future.