# British Astronomers and American Ecologists

Suppose you hear someone make the following utterance:

How would you interpret that utterance? We will use Bayes' Theorem to figure it out. There are two possibilities we will consider here: "planetary" and "plant a tree." The way that a listener interprets the utterance will be determined by whichever possibility the listener deems to have a higher posterior probability. That is:

• If p("planetary" | audio) > p("plant a tree" | audio), then the listener will hear "planetary."
• If p("plant a tree" | audio) > p("planetary" | audio), then the listener will hear "plant a tree."

Therefore, in order to determine which interpretation arises, we clearly need to figure out which of these posterior probabilities will be greater. We will use Bayes' Theorem to do this; using this theorem, we rewrite the posterior probabilities as follows:

• p("planetary" | audio) = (p(audio | "planetary") p("planetary"))/p(audio)
• p("plant a tree" | audio) = (p(audio | "plant a tree") p("plant a tree"))/p(audio)

Recall from the tutorial about the dress that we can ignore the denominators of the right hand sides (since these denominators are the same for both equations, and all we care about is which of the posterior probabilities is larger, not what their actual values are). Therefore, we can rewrite the posterior probabilities as follows (using the ∝ symbol to mean "is proportional to"):

• p("planetary" | audio) ∝ p(audio | "planetary") p("planetary")
• p("plant a tree" | audio) ∝ p(audio | "plant a tree") p("plant a tree")

This simplification is useful because it means there's one fewer thing we have to calculate. This leaves two terms on each right hand side: The likelihoods and the priors.

First we will determine the likelihoods of these two possibilities, that is p(audio | "planetary") and p(audio | "plant a tree"). How should you interpret these expressions? p(audio | "planetary") means "supposing that the speaker is saying "planetary", how likely is it that their utterance would sound the way it does in the audio clip?" Similarly, p(audio | "plant a tree") means "supposing that the speaker is saying "plant a tree", how likely is it that their utterance would sound the way it does in the audio clip?"

A major factor in determining these likelihoods is your past experience. For example, British people and American people pronounce "planetary" differently. Brits generally reduce the final "a" so that it is very short or even unpronounced:

But Americans generally do have a full vowel in that context:

Therefore, since our mystery recording does not have a clear vowel between the "t" and the "r", a Brit is relatively likely to hear it as "planetary," while an American would probably hear it unambiguously as "plant a tree."

Because of these differences, we will compute likelihoods under two sets of conditions: For an American speaker and for a British speaker.

One way we could compute the likelihood would be to treat the presence or absence of the "a" as a binary variable - that is, this vowel either will (with some probability p) appear, or will (with some probability 1-p) not appear. However, a more realistic framing of the problem is that the vowel will have some duration and that, the longer the vowel is, the more likely the word is to be interpreted as "planetary". Therefore, we will instead base the likelihoods on the duration of this vowel. The vowel itself is difficult to measure properly, so as a proxy for its length we will instead use the duration of the portion of the utterance from the "t" onward.

Below we have collected utterances from American speakers and British speakers saying "planetary" and "plant a tree." For each one, measure the duration of the part of the word from "t" to the end of the word. We will then use these measurements to get a sense of the distribution of durations.

How to do this: If you click a point in an image (each of these images is a spectrogram, which is a representation of the acoustic properties of some sound) and then drag your mouse to the right, it will highlight the portion of the spectrogram that you have dragged over. For each image, highlight the portion of the image that represents the "t" sound to the end of the word. To help, you can use the "Play entire clip" button to hear the whole clip; and once you've highlighted a section, you can click "Play highlighted portion" to make sure that what you've highlighted sounds like either "tree" or "tary." Note: Don't feel like you have to spend too much time measuring the spectrograms carefully-the important thing is that you understand how Bayes' Theorem is being used here, so it's fine if the measurements are not perfect.

Speakers of American English
American speaker 1
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 2
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 3
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 4
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 5
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 6
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 7
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
American speaker 8
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds

Speakers of British English
British speaker 1
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 2
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 3
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 4
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 5
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 6
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds
British speaker 7
"Plant a tree"
Duration of highlighted portion: 0 seconds
"Planetary"
Duration of highlighted portion: 0 seconds

Now that we've gathered this data, let's figure out how to translate the data into estimates of the likelihoods, p(audio | "planetary") and p(audio | "plant a tree"). We will do this based on histograms that show how many of your measurements fell into various intervals. Click the button "Make histograms" to generate histograms based on the data you collected:
Durations of "tree" for Americans saying "plant a tree"
Durations of "tary" for Americans saying "planetary"
Durations of "tree" for Brits saying "plant a tree"
Durations of "tary" for Brits saying "planetary"

How should you interpret these histograms? Each bar illustrates the number of measurements that fell within a certain range. For example, if you have a bar labeled "4" above the interval going from 0.4 to 0.5 in the graph of "Durations of "tary" for Americans saying "planetary"", it means that 4 Americans had a duration between 0.4 and 0.5 seconds for "tary" within their utterances of "planetary."

We can use these histograms to determine the likelihoods. First, determine the duration of the relevant portion of our mystery clip (below), just as you did with all of the examples above.

Mystery recording
Duration of highlighted portion: 0 seconds
Now, enter the duration that you measured for the relevant portion:
Using the histograms above, determine the estimate for this duration for each of our four scenarios (namely based on whether the utterance is "planetary" or "plant a tree", and based on whether the listener is American or British). To do this, find the bar of the histogram containing the duration you measured, then divide the number of elements in that bar by the total number of elements across all bars
Estimate of p(duration | "planetary") for an American listener:
Estimate of p(duration | "plant a tree") for an American listener:
Estimate of p(duration | "planetary") for a British listener:
Estimate p(duration | "plant a tree") for a British listener:

There is one other aspect we will consider for computing the likelihood. Notice how, in the clip we are trying to figure out, there is no "t" sound at the end of the first syllable. If the utterance is "planetary", that is completely expected, since the word is "planetary", not "plantetary". However, if it is "plant a tree", then this utterance could only arise if the speaker had omitted the "t" sound from "plant", making the utterance sound more like "plan a tree." Therefore, if we wish to figure out the likelihood of the utterance being "plant a tree", we have to factor in the odds of the "t" being dropped from "plant".

As it turns out, speakers of English (both American English and British English) often do drop the "t" sound (or the "d" sound) from the ends of English words. It is a well-studied phenomenon known as t/d-deletion. Because there already exists literature on this subject, we will draw our estimates of p(t is omitted) from past research.

First, based on the work of Guy (1991), we will say that p("t" is deleted | "plant a tree") = 0.38 for American speakers.

Next, based on the work of Tagliamonte and Temple (2005), we will say that p("t" is deleted | "plant a tree") = 26% for British speakers.

Now we can compute the full likelihoods. Enter them into the cells below. Hints: (i) For the "plant a tree" cases, you should factor in both the duration of the relevant portion of the clip (you computed the probability associated with this duration based on the histograms) and the deletion of the "t" sound. For the "planetary" cases, you only need to factor in the duration (since there is no deleted "t"). (ii) You can assume that the duration of the "tary"/"tree" portion of the audio is independent of the deletion or non-deletion of the "t".

p(audio | "planetary") for an American speaker:
p(audio | "plant a tree") for an American speaker:
p(audio | "planetary") for a British speaker:
p(audio | "plant a tree") for a British speaker:

Now that we have computed the likelihoods, the final ingredient we need for Bayes' Theorem is the prior probabilities. (Recall that we are ignoring the normalizing factor). To estimate the prior probabilities, we will use corpora, which are samples of text. We will state that p("planetary") is the proportion of sentences in the corpus in which the word "planetary" appears, while p("plant a tree") is the proportion of sentences in the corpus in which the phrase "plant a tree" appears. Much as whether the speaker is British or American affects his or her likelihood estimate, the speaker's experience can also affect his or her prior probabilities; for example, an astronomer might have a high prior probability for "planetary" since astronomers often talk about planets, while an ecologist might have a high prior probability for "plant a tree" since ecologists often talk about planting trees.

To allow for such differences in experience, we have included two sets of sentences below. One is the type of sentences that an astronomer might be exposed to regularly, while the other is the type of sentences that an ecologist might be exposed to regularly. Use these corpora to estmate what the prior probabilities would be for the two different types of experience:

Astronomer's Corpus
Science fiction has long dreamt of sending humans to other planets. The prospect of colonies on Mars elicits feelings of hope and wonder, and indeed such colonies may be essential to the survival of our species. Though Mars is the most frequently discussed planetary system as a potential future home for humanity, it is far from ideal. The harsh soil, extreme temperatures, and dim sunlight mean that one cannot simply plant a tree in its soil and live there in peace like the Little Prince. But Mars at least looks somewhat like Earth. Other planetary entities are too inhospitable to even be considered. There is little hope of creating a colony on a gas giant, Venus's atmosphere would kill a human in multiple ways in a matter of seconds, and Mercury has little atmosphere to speak of. Planetary motion must also be considered. Mercury and Venus are so hostile in large part because of their proximity to the Sun. Pluto's eccentric orbit takes it far beyond the regions we could hope to reach in a reasonable amount of time without major improvements in rocket technology. Of course Pluto is also not technically among the ranks of full-fledged planetary bodies being discussed here, but the category used to classify a heavenly body would not stop us from settling there. In fact, though the gas giants themselves are not welcoming hosts, their larger planetary systems do offer some potential for human habitation. Some of the moons of Jupiter and Saturn are among the most plausible candidates for preexisting extraterrestrial life. While this doesn't mean that we could immediately build a farm or plant a tree on them, it would be encouraging to know that other life had already made a home in the place we sought to inhabit. Humanity's next home might not be the rust-red soil of Mars but rather the icy surface of Europa or the dense atmosphere of Titan. The prospect of navigating a shuttle though the planetary debris around Saturn to land in a spaceport on Titan is indeed an exciting one. Even closer to home, our own moon has the distinct advantage of proximity. It remains the only world other than Earth on which humanity has set foot. Perhaps it will become the gateway to a massive planetary network hosting a diverse array of human societies. The sky's the limit - but not for long.
Ecologist's Corpus
The most widely celebrated way to help our environment is to plant a tree. There is an entire holiday, Arbor Day, devoted to the practice. Earth Day festivities often involve having people plant a tree as well. Recycling may be important to our planetary well-being, but it doesn't have two holidays dedicated to it. To understand the importance of plants, one can look back into earlier moments during Earth's planetary history. Before the advent of photosynthetic life, there was essentially no oxygen in the atmosphere. When photosynthetic cyanobacteria arose, however, they began a long cycle of increasing the oxygen levels in the air such that now Earth's atmosphere is 21% oxygen. Rarely do living things have such a massive impact on the chemical composition of the planet. The one other case of such an impact is human-caused pollution, which is far less beneficial. If you don't want to plant a tree, then consider raising some cyanobacteria. Beyond the atmospheric health of our planetary system, there are many other reasons to plant a tree. Trees add welcome touches of nature to gray urban landscapes. Their calm, stately presence is a soothing respite from our often harsh artificial environment. Other animals will thank you as well. Trees provide the main habitat for many other organisms. The first that comes to mind is probably the squirrel, perhaps the animal most likely to plant a tree, but there are many others as well. So go out and plant a tree! As the saying goes: The best time to plant a tree is twenty years ago. The second best time is now.
Based on these corpora, determine the prior probabilities that astronomers and ecologists would have associated with "planetary" and "plant a tree."

Data from the astronomer corpus
Total number of sentences: 20
Number of sentences containing "planetary": 6
Number of sentences containing "plant a tree": 2
p("planetary") for an astronomer:
p("plant a tree") for an astronomer:

Data from the ecologist corpus
Total number of sentences: 20
Number of sentences containing "planetary": 3
Number of sentences containing "plant a tree": 7
p("planetary") for an ecologist:
p("plant a tree") for an ecologist:

Finally, now that we have estimates for the priors and likelihoods, we can determine what the posterior probabilities are for various listeners, based on the nationalities and occupations of these listeners. Do this in the boxes below.

For an American astronomer:
p("planetary" | observed audio clip) ∝
p("plant a tree" | observed audio clip) ∝
Will an American astronomer interpret this clip as "planetary" or "plant a tree"?
Planetary
Plant a tree
For an American ecologist:
p("planetary" | observed audio clip) ∝
p("plant a tree" | observed audio clip) ∝
Will an American ecologist interpret this clip as "planetary" or "plant a tree"?
Planetary
Plant a tree
For a British astronomer:
p("planetary" | observed audio clip) ∝
p("plant a tree" | observed audio clip) ∝
Will a British astronomer interpret this clip as "planetary" or "plant a tree"?
Planetary
Plant a tree
For a British ecologist:
p("planetary" | observed audio clip) ∝
p("plant a tree" | observed audio clip) ∝
Will a British ecologist interpret this clip as "planetary" or "plant a tree"?
Planetary
Plant a tree
Do the outcomes match your intuitions? If not, think about how the simplifications we made in our modeling might have distorted the results.

### Acknowledgments

This tutorial was created with funding from a Technology Fellows Grant from the Johns Hopkins University Center for Educational Resources. We are grateful to Nick Hathaway, Brandon Klein, Sara Locke, Mary Marazita, Michael Martinez, Samantha McCoy, Dakota McCoy, Victoria McCoy, Sky Ritchie, Ollie Sayeed, Eliza Scruton, Matt Tyler, Will Van Fossen, Stephanie Wooler, and Ollie Wynne-Griffith for lending their voices to this project.