0% found this document useful (0 votes)
30 views

AE 248: AI and Data Science: Prabhu Ramachandran 2024-01-01

The document provides a summary of chapters 1-3 of a textbook on AI and data science. It covers topics like descriptive statistics, histograms, probability, conditional probability, Bayes' theorem and more. It also includes example questions to test understanding.

Uploaded by

prasan0311das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

AE 248: AI and Data Science: Prabhu Ramachandran 2024-01-01

The document provides a summary of chapters 1-3 of a textbook on AI and data science. It covers topics like descriptive statistics, histograms, probability, conditional probability, Bayes' theorem and more. It also includes example questions to test understanding.

Uploaded by

prasan0311das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

AE 248: AI and Data science

Chapter 1-3 Summary

Prabhu Ramachandran

2024-01-01

Summary of Chapters 1-3

• Self study
• Reference text book:
Introduction to Probability and Statistics for Engineers and Scientists Sheldon M. Ross,
Academic Press.
• Quick review

Nature of data and plots

• Numerical data
– Stem-and-leaf, boxplots, box-whisker plot
– Frequency distributions: histograms
– Cumulative frequency plots: ogives
– Relative frequencies
• Categorical data
– Bar charts, pie-charts

Histograms

• Choice of intervals/bins is important


– Equal length intervals
– Small data: fewer intervals
– Large data: more

1
Descriptive measures

• Central tendencies: sample mean, sample median, sample mode


• If 𝑥̄ = ∑ 𝑥𝑖 /𝑛 and 𝑦𝑖 = 𝑎𝑥𝑖 + 𝑏, then 𝑦 ̄ = 𝑎𝑥̄ + 𝑏
• Percentiles:
– At least np values <= given value. n is the total number of values in the dataset.
– At least n(1-p) values >= value p is the chosen percentile (expressed as a decimal, e.g., 0.25 for the 25th percentile).

• Quartiles: lower (first), upper (third), median (second)

Spread of data

• IQR: Inter Quartile Range


• Sample SD
• ∑𝑖 (𝑥𝑖 − 𝑥)̄ 2 = ∑𝑖 𝑥2𝑖 − 𝑛𝑥2̄
• if 𝑦𝑖 = 𝑎𝑥𝑖 + 𝑏, 𝑠2𝑦 = 𝑎2 𝑠2𝑦

Question

Marks of seven people is given as


1, 3, -1, -4, 5, -6, 8.
What is one standard deviation?

A) 2.087
B) 3.238
C) 4.580
D) 4.947

Question

Marks of seven people is given as


1, 3, -1, -4, 5, -6, 8.
What is the median?

A) -1
B) 0
C) 1
D) 2

2
Question

Marks of seven people is given as


1, 3, -1, -4, 5, -6, 8.
What is the first quartile?

A) -1
B) -4
C) 1
D) 2

Question

Marks of eight people is given as


5, 4, 5, 3, 2, 2, 1, 0
What is the mode?

A) 5
B) 2
C) 5 and 2
D) 4

Question

The frequency distribution of weights is given as,

60 61 62 63 64 65
1 2 3 4 2 1

What is the mean weight? Pick the closest value.

A) 62.54
B) 62.5
C) 63
D) 62

3
Question

For the data set shown in the histogram, which is larger; mean or median?

A) Mean
B) Median
C) Can’t tell without knowing the numbers

Chebychev's inequality

If 𝑆𝑘 = 𝑖, 1 ≤ 𝑖 ≤ 𝑛 ∶ |𝑥𝑖 − 𝑥|̄ ≤ 𝑘𝑠, then for 𝑘 ≥ 1:

𝑁 (𝑆𝑘 ) 𝑛−1 1
>1− 2
>1− 2
𝑛 𝑛𝑘 𝑘
• Handy

4
• Universal

Normal distributions

Correlation coefficient
∑𝑖 (𝑥𝑖 − 𝑥)(𝑦
̄ 𝑖 − 𝑦)̄
𝑟=
(𝑛 − 1)𝑠𝑥 𝑠𝑦
∑𝑖 (𝑥𝑖 − 𝑥)(𝑦
̄ 𝑖 − 𝑦)̄
𝑟=
√∑(𝑥𝑖 − 𝑥)̄ 2 ∑(𝑥𝑖 − 𝑥)̄ 2

• −1 ≤ 𝑟 ≤ 1
• ”Small” r implies lower correlation

Gotchas

• Correlation is NOT Causation!


• Be careful with categorical data

Sampling

• Importance of samples
• Importance of a random sample.

Basic Probability

• Sample space, outcomes, events


• Mutually exclusive events: 𝐸𝐹 = ∅
• Commutativity, associativity and distribution
– 𝐸∪𝐹 =𝐹 ∪𝐸
– (𝐸 ∪ 𝐹 ) ∪ 𝐺 = 𝐸 ∪ (𝐹 ∪ 𝐺)
– (𝐸 ∪ 𝐹 ) ∩ 𝐺 = (𝐸 ∩ 𝐺) ∪ (𝐹 ∩ 𝐺)
• DeMorgan's laws:
– (𝐸 ∪ 𝐹 )′ = 𝐸 ′ ∩ 𝐹 ′
– (𝐸𝐹 )′ = 𝐸 ′ ∪ 𝐹 ′

5
Notion of Probability

• Classical (all elem. outcomes same)


• Relative frequency
• Personal probability
• Objective vs subjective
• Frequentist vs Bayesian

Axioms

• 0 ≤ 𝑃 (𝐸) ≤ 1
• 𝑃 (𝑆) = 1
• 𝑃 (𝑈 𝐸𝑖 ) = ∑ 𝑃 (𝐸𝑖 ) when 𝐸𝑖 are mutually exclusive

• 𝑃 (𝐸 ′ ) = 1 − 𝑃 (𝐸)
• 𝑃 (𝐸𝑈 𝐹 ) = 𝑃 (𝐸) + 𝑃 (𝐹 ) − 𝑃 (𝐸𝐹 )
• Note: odds of an event: 𝑃 (𝐴)/(1 − 𝑃 (𝐴))

Permutation and Combinations

• Counting carefully!

Question

Prof. Rao has 10 books that he is going to put on his bookshelf. Of these, 4 are mathematics
books, 3 are chemistry books, 2 are history books, and 2 are language books. Jones wants to
arrange his books so that all the books dealing with the same subject are together on the shelf.
How many different arrangements are possible?

A) 4!3!2!2!
B) 4!3!2!1!
C) 4!4!3!2!2!
D) 4!4!3!2!1!

6
Question

For Mood Indigo, a group of size 5 is to be selected as the chief organizers from a collection
of 6 girls and 9 boys. If the selection is random, what is the probability that the group has 3
girls and 2 boys?

A) 420/1001
B) 240/1001
C) 360/1001
D) 300/1001

Conditional Probability

• Very important
• 𝑃 (𝐸|𝐹 )𝑃 (𝐹 ) = 𝑃 (𝐸𝐹 )
• 𝑃 (𝐸|𝐹 )𝑃 (𝐹 ) = 𝑃 (𝐹 |𝐸)𝑃 (𝐸)
• 𝑃 (𝐸) = 𝑃 (𝐸𝐹 ) + 𝑃 (𝐸𝐹 ′ )
• 𝑃 (𝐸) = 𝑃 (𝐸|𝐹 )𝑃 (𝐹 ) + 𝑃 (𝐸|𝐹 ′ )(1 − 𝑃 (𝐹 ))
= 𝑃 (𝐸|𝐹 )𝑃 (𝐹 ) + 𝑃 (𝐸|𝐹 ′ )𝑃 (𝐹 ′ )
• Independence: 𝑃 (𝐸𝐹 ) = 𝑃 (𝐸)𝑃 (𝐹 )

Question

A bin contains 5 defective (that immediately fail when put in use), 10 partially defective (that
fail after a couple of hours of use), and 25 acceptable transistors. A transistor is chosen at
random from the bin and put into use. If it does not immediately fail, what is the probability
it is acceptable?

A) 7/8
B) 5/7
C) 6/7
D) 5/8

Simple Bayes formula

𝑃 (𝐴)𝑃 (𝐵|𝐴)
𝑃 (𝐴|𝐵) =
(𝑃 (𝐴)𝑃 (𝐵|𝐴) + 𝑃 (𝐴′ )𝑃 (𝐵|𝐴′ ))

7
Question

An insurance company believes that people can be divided into two classes — those that are
accident prone and those that are not. Their statistics show that an accident-prone person
will have an accident at some time within a fixed 1-year period with probability .4, whereas
this probability decreases to .2 for a non-accident-prone per- son. If we assume that 30 percent
of the population is accident prone, what is the probability that a new policy holder will have
an accident within a year of purchasing a policy?

A) 0.3
B) 0.12
C) 0.26
D) 0.14

Question

Suppose that a new policy holder has an accident within a year of purchasing his policy. What
is the probability that he is accident prone?

A) 0.3
B) 0.4615
C) 0.26
D) 0.4

Question

A laboratory blood test is 99 percent effective in detecting a certain disease when it is, in
fact, present. However, the test also yields a “false positive” result for 1 percent of the healthy
persons tested. (That is, if a healthy person is tested, then, with probability .01, the test result
will imply he or she has the disease.) If .5 percent of the population actually has the disease,
what is the probability a person has the disease given that his test result is positive?

A) 0.3322
B) 0.3
C) 0.5
D) 0.99

Discussion

• Can we make it more effective?


• More thought and details needed
• Importance of domain knowledge

8
General case

For 𝐹𝑗 mutually exclusive, s.t. ∪𝑗 𝐹𝑗 = 𝑆

𝑃 (𝐸) = ∑ 𝑃 (𝐸|𝐹𝑗 )𝑃 (𝐹𝑗 )


𝑗
𝑃 (𝐸|𝐹𝑗 )𝑃 (𝐹𝑗 )
𝑃 (𝐹𝑗 |𝐸) =
∑𝑗 𝑃 (𝐸|𝐹𝑗 )𝑃 (𝐹𝑗 )

You might also like