# How to teach abstraction needed for programming?

I experience that my students are fixed to compute with concrete values and are not keen to think in terms of general solution like creating a mathematical function $f(n)$ , needed to write programming functions f(n).

What is a good method of teaching them this lesson, becoming able to think in abstractions like functions on natural numbers?

• Are these college level students? May 18 '17 at 1:38
• You may be interested in cseducators.stackexchange.com Jun 1 '17 at 19:12
• After programming $f(1)$, $f(2)$, ..., $f(77)$, don't they complain about the repetitive work?
– Raphael
Jun 17 '17 at 11:37
• I really like your comment @Raphael and I would accept it if I were who asks. Motivate them to look for abstraction for themselves is much better than "teach" it directly. Jun 17 '17 at 12:01