Step 1: Find the initial acceleration.
Since all surfaces are smooth and the pulley and rope are massless, the driving force is the component of weight of \(M_2\) along the inclined plane.
Therefore, driving force is
\[
M_2g\sin\theta
\]
Total mass of the system is
\[
M_1+M_2
\]
Hence, initial acceleration is
\[
a=\frac{M_2g\sin\theta}{M_1+M_2}
\]
Step 2: Find the new acceleration after changing masses.
Now, mass \(M_1\) is doubled, so new mass is
\[
2M_1
\]
Mass \(M_2\) is halved, so new mass is
\[
\frac{M_2}{2}
\]
New driving force is
\[
\frac{M_2}{2}g\sin\theta
\]
New total mass of the system is
\[
2M_1+\frac{M_2}{2}
\]
Therefore, new acceleration is
\[
a'=\frac{\frac{M_2}{2}g\sin\theta}{2M_1+\frac{M_2}{2}}
\]
Multiplying numerator and denominator by \(2\),
\[
a'=\frac{M_2g\sin\theta}{4M_1+M_2}
\]
Step 3: Express new acceleration in terms of \(a\).
From the initial acceleration,
\[
a=\frac{M_2g\sin\theta}{M_1+M_2}
\]
So,
\[
M_2g\sin\theta=a(M_1+M_2)
\]
Substituting this in \(a'\),
\[
a'=\frac{a(M_1+M_2)}{4M_1+M_2}
\]
\[
a'=\left(\frac{M_1+M_2}{4M_1+M_2}\right)a
\]
Step 4: Final conclusion.
Hence, the acceleration of the system is
\[
\boxed{\left(\frac{M_1+M_2}{4M_1+M_2}\right)a}
\]