LFD Book Forum Question on HW2.1
 User Name Remember Me? Password
 Register FAQ Calendar Mark Forums Read

 Thread Tools Display Modes
#1
08-05-2014, 10:13 AM
 yusunchina Junior Member Join Date: Aug 2014 Posts: 6
Question on HW2.1

I was, out of curiosity, trying to derive an exact theoretical expression for the expected value of v_min, and this is what I got (apologies for the poor typesetting):

E( #heads_min ) = sum from i=0 to i=10 ( P(#heads_min = i) * i )
P(#heads_min = i) = 1000 * P( one gets i intersect the others get >= i)
for which *1000 means that out of the 1000 trials, I choose one trial to be the minimum head trial.

P( one gets i intersect the others get >= i)
= P( one gets i ) * P(others get >= i)
= p(i, 10, 0.5) * [1 - F(i-1, 10, 0.5)] ^ 999
for which p is the probability mass function and F is the cumulative mass function, with parameters (number successes, total number, prob. of success). I used i-1 for F since >= i includes i itself.

and this expression yielded the result E( #heads_min ) = 3.6814, and expected v_min is thus 0.36814, which is incorrect.
Would anyone please point to me where my mistake is? I would really really appreciate it!

Here is the R code I used for the calculation:

phmin = function(i) {
u = 0.5 # probability of head
N = 10 # number of flips per trial
m = 1000 # number of trials
one_min = dbinom(i, N, u)
others_more = pbinom(i-1, N, u, lower.tail = FALSE) ^ (m-1)
return(1000 * one_min * others_more)
}

ivals = (0:10)
expect_hmin = sum(phmin(ivals) %*% ivals)
expect_hmin / 10
#2
08-10-2014, 06:49 PM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,477
Re: Question on HW2.1

Quote:
 Originally Posted by yusunchina P(#heads_min = i) = 1000 * P( one gets i intersect the others get >= i)
This formula assumes that the events "one gets i intersect the others get >= i" (with the "one" fixed at one coin at a time) are disjoint, otherwise this would be an over-count. These events are in fact overlapping. For instance, the case where all the coins get exactly i (which is admittedly an extremely unlikely event but chosen here as a simple illustration) would be counted in all 1000 cases, although it happens only "once."
__________________
Where everyone thinks alike, no one thinks very much
#3
08-11-2014, 03:51 PM
 yusunchina Junior Member Join Date: Aug 2014 Posts: 6
Re: Question on HW2.1

Thank you so much, this clears it up exactly and I changed it and got the correct answer! I'll keep working.

 Thread Tools Display Modes Linear 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 12:50 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.