CPU Performance Please, help me to understand the mathematics behind the following formula of CPI. Why do we calculate CPI the way it's done on the pic? The formula reminds me the expected value from stochastic, but do we have a random value here? 


This seems to be calculating the average number of CPU cycles per operation. There are a variety of operations that occur in different relative amounts, so you must weight the cost of an operation with its relative frequency of occurrence.
If all operations occurred with equal frequency, you would just average the cycle counts. But some are more frequent than others, so they contribute more to the weighted average.
