Identifying the relevant physics principles is a central component of problem solving. A major goal of most introductory physics courses is to help students discern the deep similarities between problems based upon the physics principles so that they can transfer what they learned by solving one problem to solve another problem which involves the same principle. We conducted an investigation in which 251 calculus- and algebra-based introductory physics students were asked explicitly in the recitation quiz to learn from a solved problem and then solve another problem that has different surface features but the same underlying physics principles. We find that many students were able to discern the deep similarities between the problems. When the solved problem was provided, students were likely to invoke the correct principles; however, more scaffolding is needed to help students apply these principles correctly.