Sonars resolve targets in range and bearing. A sonar records the arrival time and bearing of the echo from a target. When an echo is detected at time

measured relative to the time of pulse transmission, the range to the target is

, where

is the speed of sound in water. The detection of an echo implies that there is a target in a cell with area

, where

is the angular resolving capability of the sonar and

is the range extent of the sonar pulse. The length in time of the sonar pulse is denoted by

. Modern sonars use short pulses and have good angular resolving capability (small

). Thus the sonar detection cell is small enough in area to contain only one target.
Consider a sonar operating in a region in which there are only two types of targets: fish (

) and an enemy submarine (

). Both the fish and the submarine are capable of producing an echo that the sonar can detect. Suppose that a sonar detection occurs at a particular range

. A question of great practical significance: what is the probability that this observed detection at range

is caused by a fish? If the echo is caused by a fish, it is a false alarm and should be ignored. However, if the echo comes from a submarine it is a very important piece of information.
In the situation that we are considering there are only two types of targets present: fish and submarines. When an echo is detected, we have two pieces of information: 1) There was a target in the sonar detection cell. Otherwise there would have been no echo. 2) The echo from the target was detectable. Since we are only considering two types of targets, the echo must come from one or the other. Let

and

respectively denote the events of fish in the cell and submarines in the cell, given that there is a target in the cell. Since the cell is small enough in area that it can only contain one target, the events

and

are disjoint and it is the case that

. If there are 9999 fish in the area of sonar operation and one submarine, then

and

.
In order to address our question, we proceed in the following fashion. Let

denote the probability that there is a fish in the cell, given that an echo is observed at range

, and let

|
r) denote the probability that there is a submarine in the cell, given that an echo is observed at range

. The probabilities

and

depend on two types of information: the sonar's performance capability against fish and submarines, and the likelihood of encountering fish and submarines. In most practical situations the sonar is more likely to encounter a fish than a submarine, since fish are much more numerous. On the other hand, submarines are easier to detect because they produce larger echoes. Bayes's theorem provides a convenient means of combining these different types of information. Bayes's theorem tells us that

,

,
where

and

denote the sonar's detection capability against fish and submarines, and the probabilities

and

are the a priori probabilities of encountering fish and submarines. Their values are based upon the relative concentrations of fish and submarines in the area in which the sonar is operating.
Use the upper two sliders on the graph to control the selection of the reflectivity (TS is target strength) of the submarine and the fish. Use the lower slider to control the a priori density of fish targets. Blue and red are used to denote performance against fish and submarines, respectively. The dashed curves show sonar probability of detection as a function of range against a given type of contact, either fish or submarine. The solid curves are the probabilities

and

For the default settings in the Demonstration and with ranges inside 2000 yards, if a contact occurs then the probability is nearly unity that it comes from a fish. Beyond 2000 yards, sonar performance against fish becomes poor and

decreases and reaches a minimum at 3000 yards. At longer ranges where the sonar works poorly against both target types, Bayes's theorem simply tells us that contacts (if they occur) come from the most prevalent type of target (fish). The Bayes probability

is directly related to

via

. The shape of the plot of

clearly lends itself to the concept of false target reduction. For additional information, see:
[1] P. Gregory,
Bayesian Logical Data Analysis for the Physical Sciences, New York: Cambridge University Press, 2005.
[2] E. T. Jaynes,
Probability Theory: The Logic of Science (G. Larry Bretthorst, ed.), New York: Cambridge University Press, 2003.
[3] R. J. Urick,
Principles of Underwater Sound, New York: McGraw–Hill, 1983.
[4] A. D. Whalen,
Detection of Signals in Noise, San Diego: Academic Press, 1971.