LFD Book Forum *ANSWER* HW 3, Questions 6, 7, 8
 User Name Remember Me? Password
 FAQ Calendar Mark Forums Read

 Thread Tools Display Modes
#1
03-05-2017, 08:44 AM
 ddrhoadarmer Junior Member Join Date: Feb 2017 Posts: 2
*ANSWER* HW 3, Questions 6, 7, 8

Am I thinking about this correctly?

Question 6:
5 because you can't form a pattern of 1 0 1 0 1

Question 7:
Not (a) because a breakpoint of 5 means that for N < 5, the number of dichotomies = 2^N. For N = 1, 2^1 = 2, but (a) returns 0.

Not (b) because for N = 3, 2^3 = 8, but (b) returns 4.

Not (d) because it's obviously greater than the upper bound proven in class. (N + 1 choose 4 > N choose 4)

So that leaves (c) or (e).

For N < 5, (c) correctly returns 2^N. For N = 5, (c) returns 31, which is 1 less than 2^N which makes sense because the only pattern we can't form with 5 points is
1 0 1 0 1

But that still leaves (c) and (e).

To convince myself that (c) was correct, I thought about it this way:

If there are N points on a line, then there are N + 1 line segments where we could place a start/end point of one of our intervals.
Split the possible dichotomies into 3 types:
(i) the chosen intervals produce no "1" values
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(ii) one interval produces a single contiguous set of "1" values and the other produces no "1" values OR (both intervals produce 1s AND (they partially overlap OR completely overlap OR are touching)). The end result is that the patterns will all look something like:
0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0
(iii) both of the chosen intervals produce a contiguous set of "1" values AND there is no overlap AND they are not touching. In other words:
0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0

There's just one pattern of type (i). Trivial.

There's N + 1 choose 2 patterns of type (ii).
N + 1 positions to place the start/end. Pick any two distinct positions and make the points between them a 1.

There's N + 1 choose 4 patterns of type (iii).
N + 1 positions to place a start/end. Pick any 4 distinct positions: A, B, C, D where A < B < C < D. Make points...
< A = 0
between A & B = 1
between B & C = 0
between C & D = 1
> D = 0

Adding these up gives (c).

Question 8:
2M+1 because it's the only one that satisfies the answer to question 6. But I feel like there's some deeper understanding I'm missing.

 Thread Tools Display Modes Threaded Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General     General Discussion of Machine Learning     Free Additional Material         Dynamic e-Chapters         Dynamic e-Appendices Course Discussions     Online LFD course         General comments on the course         Homework 1         Homework 2         Homework 3         Homework 4         Homework 5         Homework 6         Homework 7         Homework 8         The Final         Create New Homework Problems Book Feedback - Learning From Data     General comments on the book     Chapter 1 - The Learning Problem     Chapter 2 - Training versus Testing     Chapter 3 - The Linear Model     Chapter 4 - Overfitting     Chapter 5 - Three Learning Principles     e-Chapter 6 - Similarity Based Methods     e-Chapter 7 - Neural Networks     e-Chapter 8 - Support Vector Machines     e-Chapter 9 - Learning Aides     Appendix and Notation     e-Appendices

All times are GMT -7. The time now is 08:03 PM.

 Contact Us - LFD Book - Top

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.