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

MATLAB I understand Part 1. I need help with 2 and 3. Any guidance helps! Thank

ID: 2246970 • Letter: M

Question

MATLAB

I understand Part 1. I need help with 2 and 3. Any guidance helps! Thank you! I

Problem 2: TV Viewing Habits It is Sunday night and there are 3 TV shows on. We are given viewing preferences for a row of houses on a given street. The viewing data is formatted in a 1D array with shows 1-3 indicated below. Zero entries in the neighbor-hood array represent households that are undecided. In this problem we will be predicting the viewing habits of these undecided families based on viewing habits of their neighbors. The following variables are already contained in the HW4_DATA.mat file. Do NOT hard code these. They must come from the HW4 DATA file. show1- 'The Good Wife' show 2-' Once Upon a Time' ; show 3-,Masterpiece,; neighborhood = [1, 0, 3, 2, 0, 2, 1, 1, 3, 3, 1, 2, 3, 3,0] ; Part 1: First let us create an array of undecided households. Using the neighborhood array, create another array called undecided, which contains the indexes of the undecided households. For the practice dataset in HW4.DATA your output will be: Part 1: Extract Undecided Households House at index 2 House at index 5 House at index 15

Explanation / Answer

In Part 2, for each undecided house index, you have to find three value.

1. Influence of show1

2.Influence of show2

3.Influence of show3

Now, to find the influence of show1: This is inversely proportional to the distance from the neighboring house. This means for Undecided house 2, house 1 and 3 influence the most. So, to find the denominator you just need to calculate the absolute distance. For the numerator, you will have 1 if that house watches show1 otherwise 0. Then add all these terms. Likewise, you can find the influence of show2 and show3. As per the example in the question, for house 2 the influence to the show1 is 1.48, the influence to the show2 is 0.85 and the influence to the show3 is 1.44

Same way you can find influence scores for other undecided house.

You have to create three arrays of size equal to a number of undecided houses. One for to store the influence score of show1.Second for to store the influence score of show2.Third for to store the influence score of show1.

Part 3

In part 3 for each undecided house index i, you have to find the maximum of influence score of show1[i], influence score of show2[i] and influence score of show3[i]. The house i will watch the show which has the most influence score.