Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A local supermarket specializing in breakfast cereals decides to analyze the buy

ID: 669132 • Letter: A

Question

A local supermarket specializing in breakfast cereals decides to analyze the buying patterns

of its customers. They make a small survey asking 6 randomly chosen people their age (older or younger

than 60 years) and which of the breakfast cereals (Corn akes, Frosties, Sugar Pus, Bran akes) they

like.Each respondent provides a vector with entries 1 or 0 corresponding to whether they like or dislike

the cereal. Thus a respondent with (1101) would like Corn akes, Frosties and Bran akes, but not Sugar

Pus. The older than 60 years respondents provide the following data (1000); (1001); (1111); (0001).

The younger than 60 years old respondents responded (0110); (1110). A novel customer comes into the

supermarket and says she only likes Frosties and Sugar Pus. Using naive Bayes trained with maximum

likelihood, what is the probability that she is younger than 60? Show your work.

Explanation / Answer

(Corn akes, Frosties, Sugar Pus, Bran akes)

Total number of survey respondents = 6

Older than 60 years of age = 4

Younger than 60 years of age = 2

Novel Customer: (0110)

Steps:

1. Construction of the training set:

Age group

Corn akes

Frosties

Sugar Pus

Bran akes

Above 60 respondent 1

1

0

0

0

Above 60 respondent 2

1

0

0

1

Above 60 respondent 3

1

1

1

1

Above 60 respondent 4

0

0

0

1

Below 60 respondent 1

0

1

1

0

Below 60 respondent 2

1

1

1

0

Younger than 60 certainly likes Frosties and Sugar Pus – The novel customer likes these 2.

Posterior(Older than 60) = ( P(Older than 60) p(Likes Corn akes|Older than 60) p(Likes Frosties| Older than 60) p(Likes Sugar Pus | Older than 60) p (Likes Bran akes | Older than 60) ) / evidence

Posterior(Younger than 60) = ( P(Younger than 60) p(Likes Corn akes| Younger than 60) p(Likes Frosties| Younger than 60) p(Likes Sugar Pus | Younger than 60) p (Likes Bran akes | Younger than 60) ) / evidence

where evidence or normalizing constant = P(Older than 60) p(Likes Corn akes|Older than 60) p(Likes Frosties| Older than 60) p(Likes Sugar Pus | Older than 60) p (Likes Bran akes | Older than 60) + P(Younger than 60) p(Likes Corn akes| Younger than 60) p(Likes Frosties| Younger than 60) p(Likes Sugar Pus | Younger than 60) p (Likes Bran akes | Younger than 60)

The evidence is simply the sum or addition of both of the numerators for both Posteriors.

Age group

Corn akes

Frosties

Sugar Pus

Bran akes

Above 60 respondent 1

1

0

0

0

Above 60 respondent 2

1

0

0

1

Above 60 respondent 3

1

1

1

1

Above 60 respondent 4

0

0

0

1

Below 60 respondent 1

0

1

1

0

Below 60 respondent 2

1

1

1

0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote