example 1.10 (learning from data)