4

a: 10%

b: 1%

c: 0.1^100

d: if p is large when using KNN, there are very few training observations near any given test observation. Because the average fraction of the observations to be used decrease by exponential rate to the power of p.

e: 10%, sqrt(10%), (10%)^(1/100)

6

b0=-6 ; b1=0.05 ;b2= 1
linearm = b0 + b1*40 + b2*3.5 
1-1/(1+exp(linearm))
## [1] 0.37754066879814541
p=0.5
(log(p/(1-p))-(b0-b2*3.5))/b1
## [1] 190

7

pi1=.8;pi2=.2
mu1=10;mu2=0
sigma2=36
x=4
(score1 = log(pi1) - (mu1^2)/(2*sigma2) + (x*mu1)/sigma2)
## [1] -0.50092132909198739
(score2 = log(pi2) - (mu2^2)/(2*sigma2) + (x*mu2)/sigma2)
## [1] -1.6094379124341003

the test point belong to the group that will issue the dividend.

pi1*dnorm(x = x,sd = sqrt(sigma2),mean = mu1)/(pi1*dnorm(x = x,sd = sqrt(sigma2),mean = mu1)+pi2*dnorm(x = x,sd = sqrt(sigma2),mean = mu2))
## [1] 0.75185245329752615

the probability of x to issue dividend is 0.75.