Stochastic Signal Analysis

What's the word "stochastic" mean?

The word stochastic is often used as an erudite (or what my mother would call up-ity) synonym for the word: random. But there is a formal, and informal, rule for when to use stochastic rather than random.

Formally: Random describes the signal, while stochastic describes the type of analysis. A grammatically precise title for this class would be: Stochastic Analysis of Random Signals. We didn't do that, because people who don't appreciate the formal distinction between random and stochastic find the title redundant.

Informally: We use the term "random" when we are working with a random number, or a random vector (a finite group of numbers). We are not careful to say if it is the number, or the analysis, which is random. We use the term "stochastic" when dealing with a random discrete time signal (a countably infinite group of random numbers) and signals (an uncountably infinite group of random numbers). We apply the word stochastic to both the signal itself, and the analysis.

Known, Unknown, Partially Known and Random Numbers

We say we know the value of variable x if we write something like x=4. If there is an expression that a sufficiently smart person, or calculator, can solve, we still say x is known. For example, x is known when x=sqrt(88)*cos(2**456.789), even if you don't know how to find the value without the help of a calculator.

If we know nothing at all about x, then we say it is unknown. For example if I ask you the distance between two points, with no other information, you have no idea what number to use.

EE 5440 Page 1 Sometimes we have partial information about x, but don't know it's exact value. We may know that x is confined to a particular range of the number line, as in 4>x>3 or x=sin(theta) (which is the same as -1 ≤ x ≤ 1). Or we may know that x is one of a few different possible values, as x2=4, which means x is -2 or 2, but we don't know which. We may also know that x is an imaginary number, because x2<0. Or we may know that x is an integer, or rational, or irrational, or transretinal, etc. There's many different ways we can describe partial information about a variable.

The variable x may be called a random variable. This means it is partially known, and the partial information we have fits a very specific set of rules. These rules give us an idea about not only the range x may take on, but that it has a preference for some of these values more than others. The rules that describe this preference are known as a measure.

Non-Stochastic Analysis of Random (or other partially known) Variables

You don't have to use stochastic analysis to handle partially known variables, or the particular class of partially known variables called random variables. One non-stochastic method is worst-case analysis.

Example. There is an iconic suspension bridge in San Francisco California, known as the Golden Gate bridge. It was completed in 1937, and designed to carry 6 lanes of vehicle traffic. The load on the bridge varies with the number of vehicles, weight of each vehicle, wind conditions, and earth movement.

The designers wanted to make sure the bridge would never fail, so they designed the structure to hold the most dense vehicles allowed on federal highways, packed bumper-to-bumper in all 6 lanes of the entire span of the bridge. They also assumed this would occur when there were gale force winds blowing, and a major earthquake was underway on a nearby geologic fault. They estimated in this situation, the loading on the bridge deck could reach about 4 kN/m2, (about 85 lbs per square foot). On a typical day, the bridge does

EE 5440 Page 2 about 4 kN/m2, (about 85 lbs per square foot). On a typical day, the bridge does not come anywhere close to experiencing this high of a load.

On May 24th of 1987, there was a celebration on the bridge, as it was 50 years since it's completion. The bridge was shutdown to vehicle traffic, and roughly 250 thousand pedestrians were allowed to walk on the bridge.

This is the heaviest the bridge had ever been loaded (the center of the span drooped over 2 meters from it's un-loaded height). The load approached 3 kN/m^2, or 75% of its maximum design load.

While 250 thousand were allowed on the bridge, another 500 thousand were turned away. While these half million people were probably disappointed, notice that if they had been allowed on the bridge, it may have catastrophically failed.

Random or Stochastic Analysis

The worst case analysis described above is not always useful. Suppose there is

EE 5440 Page 3 The worst case analysis described above is not always useful. Suppose there is an electronic system that can cause dramatic damage, if it is accessed by an unauthorized individual. I plan to protect it by asking a user to enter a password with N characters. If the user gets the password wrong, they will have to wait one minute before trying again. How large does N have to be, so that I'm confident unauthorized users (who have never been told the password) cannot access the system?

Worst case analysis says that no matter what you choose for N, the system is not secure. Even if N=100, it's possible an unauthorized user will correctly type all N characters on the first attempt. Or if they don't get it on the first attempt, they can eventually guess the correct sequence.

This concept is sometimes called the Infinite Monkey Theorem

It has roots that go back at least as far as the ancient Greek philosopher . It has been rephrased and updated many times over the ages, with one version being: If a monkey is set in front of a typewriter and randomly hits keys for an infinite period of time, he will eventually type the complete works of William Shakespeare.

I prefer an updated version that may have first shown up in 1996 in a speech by Robert Wilensky: We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.

But, thanks to the Wikipedia page dedicated to the Infinite Monkey Theorem I know the following:

EE 5440 Page 4 know the following:

In 2002, lecturers and students from the University of Plymouth MediaLab Arts course used a £2,000 grant from the Arts Council to study the literary output of real monkeys. They left a computer keyboard in the enclosure of six Celebes crested macaques in Paignton Zoo in Devon, for a month, with a radio link to broadcast the results on a website.

Not only did the monkeys produce nothing but five total pages largely consisting of the letter 'S', the lead male began striking the keyboard with a stone, and other monkeys followed by soiling it.

Mike Phillips, director of the university's Institute of Digital Arts and Technology (i-DAT), said that the artist-funded project was primarily performance art, and they had learned "an awful lot" from it.

Getting away from monkeys, and back to passwords, let's look at how long it would take someone to try every possible combination of 100 characters.

If you can choose from 26 lower case, 26 upper case, 10 digits and 10 special characters, you have 26+26+10+10=72 choices for each character. That means there are 72*72 ways to pick two characters, 72*72*72 ways to pick three characters, and 72^100 ways to pick 100 characters. That is over 10^185 possible combinations.

I find it difficult to put large numbers like this into perspective. Let's compare it to the . Scientists currently estimate the that was the origin of the universe occurred about 10^24 seconds ago. So if someone started guessing passwords when the universe was young, to get through all N letter combinations by today, they would have to guess 10^161 combinations per second.

This may incorrectly lead you to believe that a 100 digit password is for all practical purposes impossible to break. For a set of 100 randomly selected

EE 5440 Page 5 practical purposes impossible to break. For a set of 100 randomly selected characters, this is pretty much true with current technology. However human factors can dramatically reduce its security.

If people are allowed to select their own password, they are inclined to use words. Assume someone has a vocabulary of about 10,000 words, and each are about 5 characters long. Then, 100 characters is 20 words, and there are roughly 10,000^20. Now there are only 10^80 possible passwords. The problem of cracking the password just got easier by a factor of 10^100. Take into account that many people pick a string of 20 words which are form a grammatically correct sentence, and the password becomes even less secure.

Simple counting often is insufficient in situations like this. We need a way to quantify what words, and sequence of words, people are likely to pick. We then need to see how likely that makes it that a very intelligent and motivated hacker could guess that string of words in a reasonably short period of time. This is where stochastic analysis comes in.

By the way - quantum computing has the potential to guess more than one character string at a time. This could make even a 100 digit password insecure - but that's beyond the scope of this course.

Probability

To do stochastic analysis, we need to characterize what we know about random numbers, or stochastic signals, in a very specific way, with many restrictions on the format of the information. This is known as a probability measure. The rules about how we can use a probability measure to make predictions is called .

Probability vs.

While probability and statistics are often taught together, the they answer different questions. Probability is a strictly mathematical endeavor, like ,

EE 5440 Page 6 different questions. Probability is a strictly mathematical endeavor, like algebra, or . Statistics is more of an art form, where personal preference can influence the results as much as mathematical calculations.

In probability theory, we start with a set of assumptions. We make no attempt to determine if the assumptions are reasonable or unreasonable. We then use tools like , algebra, geometry, calculus, etc. to make predictions based on our assumptions.

Statisticians compare different sets of assumptions to observations from the physical world. They try to convince us which of the assumptions are the best fit.

Anyone who studies statistics should be aware of a famous quote often attributed to Mark Twain, but which probably originated elsewhere: There are three types of lies: lies, damned lies, and statistics. It may have been motivated by earlier comments about how the experts called to testify in legal cases are known to give false testimony. That quote is similar to: A well-known judge said witnesses fall into one of three categories: simple liars, damned liars and experts.

To illustrate the difference between probability and statistics, consider the following example.

Example: In the game of craps, a player rolls two 6-sided dice, and sums the numbers on the top faces. This produces an integer from 2 to 12 (since each die has the numbers 1 through 6).

To play a game of craps, a player must first hand X dollars to the house. The player is then allowed to toss the dice until they either win or lose. They may toss the dice once, or do so many times (see below). If the player ultimately wins, the player gets back their original X dollars, plus another X dollars. This is known as an even-money bet. If the player ultimately loses, the house does not return the X dollars the player paid to play.

EE 5440 Page 7 return the X dollars the player paid to play.

There are different ways people can win or lose in craps. The most fundamental is called a "pass bet". A player wins if on their first throw of the dice, they come up 7 or 11. The player loses if on the first throw the dice come up 2, 3 or 12 (which is called craps).

If the first roll produces something other than 2, 3, 7, 11, or 12, that number becomes the "point". The player continues to toss the dice until they either have a 7, or the point repeats. If the 7 shows first, the player loses. If the point shows before the 7, the player wins.

It is common to assume that on each throw, each of the dice are equally likely to show the numbers 1, 2, 3, 4, 5 or 6. It is also common to assume that the value on any one die has nothing to do with the other die thrown at the same time, and has nothing to do with the values that die has shown on previous throws. If this assumption is true, we say the dice are "fair".

Probability can tell us the chance a player can win at a game of craps when using fair dice. The chance of winning is about 49.29%.

Probability cannot tell us if the assumption we are using fair dice is accurate. For that, we need statistics.

Example: If a gambler plays multiple games in sequence, their money will typically fluctuate up and down. The trick is to quit while they are ahead (have more money than they started with). Some people use algorithms, called betting schemes, to try to ensure they will always win some money, and will know when to quit.

One of these schemes is called a martingale, and is summarized below

Step 1: You have now won the game N times (initially N=0), and have N dollars more than you started with. It is OK to quit. If you want to earn one more

EE 5440 Page 8 more than you started with. It is OK to quit. If you want to earn one more dollar, go to step 2. But once you get to step 2, keep playing until you are directed to return here, to step 1.

Step 2: Bet $1 on any even-money game. The chances that you win the game are irrelevant, provided the chance is greater than zero.

Step 3: If you win, go to step 1. If you lose, play again, but up your bet to $2.

Step 4: If you win, go to step 1. If you lose, play again, but up your bet to $4.

Step 5: If you win, go to step 1. If you lose, play again, but up your bet to $8.

Step 6+: As soon as you win, go back to step 1. Each time you lose, double your bet, and play again.

Notice that whenever you win, you will get back all of the funds you have bet since leaving step 1, plus one dollar. Some people see this as a fool-proof way to make money.

There is a problem with this approach. It only guarantees you make money, if you have sufficient funds to cover your bets, and the house will accept the bet. In practice, the house will always have an upper limit on the bet they will accept. Even in Las Vegas, you can't get the house to accept a bet of a trillion dollars (for that, you need to go to the US congress). Once the house refuses your bet, you have lost - and lost big.

This is one example of what is known as the gambler's ruin. If the chance of winning an even-money game is less than 50%, and a player plays long enough, they will always lose all their money. That's true no matter how much money they have to start with, and no matter what betting strategy they use. It is why casinos can survive, and why they usually have no windows and no clocks.

Despite this drawback, a martingale can be an entertaining betting strategy.

EE 5440 Page 9 Despite this drawback, a martingale can be an entertaining betting strategy. Probability theory will allow us to answer questions such as this: I am willing to risk losing up to $1,024 at a craps table. I will quit playing craps if I win $10. If I the craps dice are fair, what are the chances I quit because I have won $10, and what's the chances I quit because I have exhausted the $1,024 I came with, using a martingale betting strategy?

EE 5440 Page 10