What is the difference between deduction and inference?
My guess is that deduction is a more concrete and restricted opinion because it involves logic every time whereas inference is a mere guess on the given evidences or situations and it involves logic sometime.
What does Sherlock Holmes do? Is it deduction or inference?
To deduce and infer are largely interchangeable, but…
deduce is more likely to be used where you arrive at some conclusion after a more prolonged logical analysis of relevant factors (which may not even be readily apparent until actively sought out).
Whereas you often infer a conclusion almost instantly, from directly-observable factors.
Since Sherlock is the archetypal solver of complex/non-obvious mysteries, he tends to deduce…
I personally don’t recognise OP’s formal logical reasoning vs inspired guess distinction, except insofar as it may reflect the above tendency for deduction to sometimes be a more lengthy process.