Let
N be the number of instruction to process.
Then
0.1 x N is the number of instructions needing to access main memory on instruction fetch.
0.3 x N is the number of instructions accessing data.
0.2 x 0.3 x N is the number of instruction needing to access main memory for the data.
CPI = (A + B + C)/N
where
A = N is the number of cycles the N instructions would require without any cache misses,
B = 0.1 x N x 10 is the number of cycles the N instructions require in accessing main memory during instruction fetch.
C = 0.2 x 0.3 x N x 10 is the number of cycles the N instructions require in accessing main memory during data access.
Evaluating the above:
CPI = 2.6