Current-day embedded systems are very vulnerable to faults and defects. Anomaly detection is often the primary means of providing early indication of faults and defects. This paper presents a probabilistic method, which employs the probability of data events to evaluate the behavior of system. In order to measure the probability of events in the system, sampling of two events with distinct distance is done. Consequently, during test stage, the probability of events can be measured. An anomaly exists in test data provided that this probability does not reach a predefined threshold. The experiments on 112 standard benchmarks show that the proposed method can detect 100% of anomalies. Also, the area overhead of the proposed detector grows linearly, while the area overhead of other typical detectors grows exponentially by the increase in one of the detector's parameters.