Cryptanalysing Affine cipher
Once you know (you didn't question that) that $a = 3$, then knowing 4 goes to 17, using $f(x) = 3x + b$, we just substitute $x = 4$ to get $3 * 4 + b = 12  + b = 17 \mod 26$, where we can easily see that $b= 5$ does the job.