查看: 1196| 回复: 0
跳转到指定楼层
上一主题 下一主题
收起左侧

数科面经之硬币问题

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
楼主整理了数据科学面试过程中,出现的硬币问题及答案,求米

Say you flip a coin 10 times and observe only one head. What would be your null hypothesis and p-value for testing whether the coin is fair or not?.1point3acres
•        the null hypothesis is that the coin is fair, and the alternative hypothesis is that the coin is biased
•        H0: P0=0.5
•        H1: P1!=0.5
•        note that, since the sample size here is 10<30. you canot apply the central limit theorem
. 1point 3acres •        The p-value here is the probability of observing the results obtained given that the null hypothesis is true, i.e., under the assumption that the coin is fair. In total for 10 flips of a coin, there are 2^10=1024 possible ourcones. there in only 10 of them are there 9 tails and one heads. Hence, the exact probability of the given results is the p-value, which is 10/1024=0.0098. Therefore, with a significance level set, for example, at 0.05, we can reject the null hypothesis.
. 1point 3acres
Given an unfair coin, how to generate a fair coin?.--
•        assume the probability of head is p, and toss it twice
•        we could take (head, tail) as head, the probability is p(1-p)
•        we could take (tail, head) as tail, the probability is p(1-p). Χ
•        When (tail, tail) or (head, head), we just ignore them
.
Assume two coins, one fair and the other unfair (having both side tails). You pick one at random, flip it five times, and obser that it comes up as tails all five times. What is the probability that you are flipping the unfair coin?
F as fair coin, U as unfair coin, 5T as five tails. 1point 3acres
  • P(5T)=P(U)*P(5T│U)+P(F)*P(5T│F)=0.5*1+0.5*(1/32)
  • P(U)=P(F)=0.5
  • P(U │ 5T)=P(5T |  U)*P(U)/P(5T)=0.97
. .и
. 1point 3acres

评分

参与人数 3大米 +18 收起 理由
梦之啸 + 2 给你点个赞!
vegepiggy + 1 很有用的信息!
bryanjhy + 15 给你点个赞!

查看全部评分


上一篇:求靠谱看job opening的途径
下一篇:统计常见问题
您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表