We study a system with two types of interacting particles on a one-dimensional lattice. Particles of the first type, which we call 'active', are able to detect particles of the second type (called 'passive'). By relating the problem to a discrete random walk in one dimension with a fixed number of steps we determine the fraction of active and detected particles for both open and periodic boundary conditions as well as for the case where passive particles interact with both or only one neighbors. In the random walk picture, where the two particles types stand for steps in opposite directions, passive particles are detected whenever the resulting path has a corner. For open boundary conditions, it turns out that a simple mean field approximation reproduces the exact result if the particles interact with one neighbor only. A practical application of this problem is heterogeneous traffic flow with communicating and non-communicating vehicles. In this context communicating vehicles can be thought of as active particles which can by front (and rear) sensors detect the vehicle ahead (and behind) although these vehicles do not actively share information. Therefore, we also present simulation results which show the validity of our analysis for real traffic flow.