Redian新闻
>
R 编程面试题,被弄残废了,在这里求解,钱不多,但会鼎力散财(转载)
avatar
R 编程面试题,被弄残废了,在这里求解,钱不多,但会鼎力散财(转载)# Biology - 生物学
a*y
1

马上来更新跑分
Geekbench
10.8.2下最高跑出14072
10.8.3下跑出14904
整数和浮点运算都小有提升。
avatar
x*0
2
【 以下文字转载自 Statistics 讨论区 】
发信人: xzxz0000 (凶涨凶涨), 信区: Statistics
标 题: R 编程面试题,被弄残废了,在这里求解,钱不多,但会鼎力散财,
发信站: BBS 未名空间站 (Sat Apr 14 20:21:09 2012, 美东)
面试了一个software职位,本以为很有戏,但考我的题基本上全是job description上
没有的R 编程,希望这里的大侠帮助解惑答疑,在下感恩不尽。
1)
An analytical technique used in a molecular biology lab involves dispensing
solutions of DNA in very
low concentration into 384-well plates. Consider the perfectly random
distribution of N=30 molecules
onto this device
a) What is the probability that two molecules fall in the same well? Derive
the closed-form
equation for this probability.
b) Plot the above expression for the probability as a function of the number
of molecules
dispensed.
c) Solve the same problem by means of a simulation. Include your R code and
provide
appropriate statements to insure exact reproducibility of your simulation
results
d) Consider the case where the above-described device is affected by the so
called “edge
effects” – that is, the probability of a molecule landing in the wells
located on the edge of the plate is
smaller than the probability of a molecule landing in any other well.
Assuming that the probability ratio
is 1/3, revise the simulation above to calculate the probability that half
of the molecules are found in the
center wells of the plate.
2)
For a given SNP with alleles a and A, the minor allele frequency is .
Assume that this frequency is the
same for both males and females, that there is no migration in or out of the
population, and that there
is no selective advantage for either allele. The proportions of these
alleles are stable in the population
over time. Denote the possible genotype states by aa=1, Aa=2, and AA=3. The
evolution of a population
over time considering this SNP alone can be described, e.g, as follows: in
the first step, a female is of
genotype aa so it is in state 1 ( . In the next step, a mate is selected
at random and one or more
daughters are produced, eldest of whom had genotype . In the following
step, this daughter selects a
mate at random and produces an eldest daughter with genotype and so on.
a) Calculate the transition matrix for the above Markov chain.
b) Show that this chain is ergodic. What is the smallest number of
iterations, N, for which the
power N of the transition matrix is strictly positive?
c) According to the Hardy-Weinberg law, this chain is supposed to have a
steady-state
distribution σ= [ ( ( ]. Does this match the calculated steady
state?
d) For , simulate this chain for n=100,000 iterations and compare the
sampling
distribution of the simulated states with the one from the Hardy-Weinberg
vector. Show your
code and include statements to insure exact reproducibility of your
simulation.
3)
A certain molecular analyte, comprised of long quasi-linear macromolecules
with approximately
constant length l is analyzed with the help of a specialized detector. This
detector is assembled in the
form of many parallel long strips, each strip of width L. If the
macromolecules are randomly distributed
across the surface of the detector, what is the probability that such a
macromolecule would cross the
boundary between two strips? (Assume that l is smaller than L and ignore any
“edge effect”, i.e., assume
the detector has a large surface.)
avatar
C*d
3
我等升级之后也测测
avatar
b*y
4
Not crystal clear about the questions. But still try to answer some.
a) 1-(384!/354!)/(384^30)
b) plot 1-(384!/(384-n)!)/(384^n)
c) should be easy as long as the # of MC runs are large enough
d) make sure to count the # of wells on the edge right, i.e. don't double
count the ones on the four corners.
more later if time permitted.
avatar
a*y
5
我的黑金塔本来装完就起不来了。不过不知道后来怎么又好了。

【在 C***d 的大作中提到】
: 我等升级之后也测测
avatar
x*0
6
对R实在一天内不能速成,我是用perl写的,好像和你的不一样嘛,主要部分是
my $prob=0;
for(my $i = 2; $i<=$nofN; $i++)
{
$prob += (1 - $prob) / ($nofM - $i + 2);
}
print "\nProbability that two molucules fall in the same well is " . sprintf
("%.4f", $prob) . "\n";
avatar
c*l
7
我的装了就起不来了

★ 发自iPhone App: ChineseWeb 7.8

【在 a***y 的大作中提到】
: 嗯
: 马上来更新跑分
: Geekbench
: 10.8.2下最高跑出14072
: 10.8.3下跑出14904
: 整数和浮点运算都小有提升。

avatar
l*1
8
以下的R script code 大部分看明白了
那个384 wells-plate 题目必会解了
DEGseq R Script mian branch:
cited:
###################################################
### code chunk number 4: DEGseq.Rnw:244-252
###################################################
kidneyR1L1 liverR1L2 refFlat mapResultBatch1 mapResultBatch2 outputDir DEGseq(mapResultBatch1, mapResultBatch2, fileFormat="bed", refFlat=refFlat,
outputDir=outputDir, method="LRT")
others Script link:
//bioconductor.org/packages/release/bioc/vignettes/DEGseq/inst/doc/DEGseq.R
original paper:
//www.ncbi.nlm.nih.gov/pubmed/19855105
or
//bioconductor.org/packages/release/bioc/html/DEGseq.html
more details:
//bioinfo.au.tsinghua.edu.cn/software/degseq/
relative E-books link:
//bioconductor.org/packages/release/bioc/vignettes/DEGseq/inst/doc/DEGseq.
pdf
or
//bioconductor.org/packages/release/bioc/manuals/DEGseq/man/DEGseq.pdf

sprintf

【在 x******0 的大作中提到】
: 对R实在一天内不能速成,我是用perl写的,好像和你的不一样嘛,主要部分是
: my $prob=0;
: for(my $i = 2; $i<=$nofN; $i++)
: {
: $prob += (1 - $prob) / ($nofM - $i + 2);
: }
: print "\nProbability that two molucules fall in the same well is " . sprintf
: ("%.4f", $prob) . "\n";

avatar
m*r
9
R是比较麻烦

dispensing

【在 x******0 的大作中提到】
: 对R实在一天内不能速成,我是用perl写的,好像和你的不一样嘛,主要部分是
: my $prob=0;
: for(my $i = 2; $i<=$nofN; $i++)
: {
: $prob += (1 - $prob) / ($nofM - $i + 2);
: }
: print "\nProbability that two molucules fall in the same well is " . sprintf
: ("%.4f", $prob) . "\n";

avatar
t*s
10
见过懒的,但没见过这么懒的。
公司的面试题你不会做,拿来问也就算了,但你至少改写一下吧,你还原文copy。
你拿到题目的时候也答应过公司不外传的,现在你要给公司的人查出来一群中国人在讨
论,你让公司以后还找中国人不?而且这个公司里的中国人也不少。
我建议你或者版主把这个贴删了。
avatar
s*y
11
这些个话虽然有点难听,但的确是对的。楼主的做法的确不是很professional,
而且还到处贴。至少得把题目的一些字眼改一改,不然万一被公司的HR发现就
麻烦了。

【在 t******s 的大作中提到】
: 见过懒的,但没见过这么懒的。
: 公司的面试题你不会做,拿来问也就算了,但你至少改写一下吧,你还原文copy。
: 你拿到题目的时候也答应过公司不外传的,现在你要给公司的人查出来一群中国人在讨
: 论,你让公司以后还找中国人不?而且这个公司里的中国人也不少。
: 我建议你或者版主把这个贴删了。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。