Write SQL query to solve given problem: What is the average number of courses taught by a professor?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) AS num FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1