If you put a device there to measure which slit is taken by the electron the interference pattern would go away. Instead of I(x)=|A1(x)+A2(x)|^2, we get either I(x)=|A1(x)|^2 or I(x)=|A2(x)|^2. This means the intensity pattern on the screen would only be two lines right behind the slits. The total intensity in function of x and the amplitudes is thus given by I(x)=p1I1(x)+p2I2(x)=p1|a1(x)|^2+p2|a2(x)|^2, where p1 and p2 are the probabilities for an electron to pass throus lit 1 or 2. In general p1=p2=1/2.