Operating Systems – How can we calculate how many processes should be in memory at the same time to maximize CPU utilization?

To let $ U $ specify the CPU utilization in percent. What you have calculated is:
$$ log (U) = log (1 – P ^ n) stackrel {!} = log (1) – log (P ^ n) = log (1) – n log (P) $ $

However, the equality marked with an exclamation mark is incorrect $ log (a – b) $ is in general Not equal $ log (a) – log (b) $,

The correct argument restores the original equality as $ P ^ n = 1 – U $ and then:
$$ n log (P) = log (P ^ n) = log (1 – U) $$
Thus:
$$ n = frac { log (1 – U)} { log (P)} $$

(Of course, everything provided $ P> 0 $ and $ U <1 $; Otherwise there is no (unambiguous) solution.)


Tip: When you rewrite math expressions, you always do one step at a timeand question every single step! Otherwise you are bound to make mistakes. (Source: personal experience)