LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 3

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2017, 07:44 AM
ddrhoadarmer ddrhoadarmer is offline
Junior Member
 
Join Date: Feb 2017
Posts: 2
Default *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.
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump


All times are GMT -7. The time now is 05:17 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2017, 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.