Phan Phoi Lien Tuc

download Phan Phoi Lien Tuc

of 2

Transcript of Phan Phoi Lien Tuc

  • 8/12/2019 Phan Phoi Lien Tuc

    1/2

    R version 2.11.1 (2010-05-31)Copyright (C) 2010 The R Foundation for Statistical ComputingISBN 3-900051-07-0

    R is free software and comes with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under certain conditions.Type 'license()' or 'licence()' for distribution details.

    Natural language support but running in an English locale

    R is a collaborative project with many contributors.Type 'contributors()' for more information and'citation()' on how to cite R or R packages in publications.

    Type 'demo()' for some demos, 'help()' for on-line help, or'help.start()' for an HTML browser interface to help.Type 'q()' to quit R.

    > library(BSDA)Error in library(BSDA) : there is no package called 'BSDA'> utils:::menuInstallPkgs()--- Please select a CRAN mirror for use in this session ---Error in contrib.url(repos, type) :

    trying to use CRAN without setting a mirrorIn addition: Warning message:In open.connection(con, "r") : unable to resolve 'cran.r-project.org'> #phan phoi lien tuc> #1. phan phoi chuan> #neu X~N(nu, sima^2)> #P(X=a)=0> #P(X #P(X=a)=P(X>a)=1-pmorm(a,mu,sigma)> #P(a #ham qnorm la ham nguoc cua ham pnorm

    > #cho truoc mot cai xac suat la p0> # tim a sao cho P(X #a=qnorm(p0,mu,sigma)>> #tim asao cho P(x>a)=p0> # a=pnorm(1-p0,mu,sigma)> # a=qnorm(1-p0,mu,sigma) dung>>> #2. phan phoi mu> # neu X~exp(lamda)> #P(X #P(X>a)=1-pexp(a,lamda)

    > #P(a # bai tap> # bai 41> #cho X~N(8,5)> #a. P(X>5)> 1-pnorm(5,8,5)[1] 0.7257469>> #b.P(2

  • 8/12/2019 Phan Phoi Lien Tuc

    2/2

    > pnorm(6,8,5)-pnorm(2,8,5)[1] 0.2295086>> #tim Xo sao cho P(X #tim Xo sao cho P(X qnorm(0.4,8,5)[1] 6.733264> #tim Xo sao cho P(X>Xo)=0.8> qnorm(1-o.8,8,5)Error in qnorm(1 - o.8, 8, 5) : object 'o.8' not found> qnorm(1-0.8,8,5)[1] 3.791894>> #bai 44> qnorm(1-0.1,100,14.2)[1] 118.1980> #theo bai ta co X~N(100,14.2)> # goi a la chi so IQ thap nhat trong nhom 10% nhung nguoi co chi so IQ cao nhat the gioi> #a la gia tri de P(X>a)=10%> qnorm(1-0.1,100,14,2)[1] 117.9417> qnorm(1-0.1,100,14.2)[1] 118.1980

    > #bai 42> #GOI X la so nam trong 4 nam co luong mua khong qia 1600> #X tuan theo phan phoi nhi thuc voi n=4,p=?> #trong do P la xac suat de luong mua trong nam khong qua 1600> # goi Y bnn chi luong mua trong 1 nam,Y~N(1800,100)> #p=P(Y p=pnorm(1600,1800,100)> p[1] 0.02275013> # vay xac suat de co 2 trong 4 nam co luong mua khong qua 1600> #P(x=2)> #X~B(n=4,p)va bang ham dbinom(2,4,p)> dbinom(2,4,p)

    [1] 0.002965721>> > #bai 45> # goi X la so dam ma mot chiec oto di duoc cho den hong> # X~EXP( lamda=1/20)> # trung binh mot 0 to di duoc 20 dam thi hong> #1. tinh kha nang ma mua mot oto moi ma di duoc 20 dam> #2. tinh kha nang mua oto cu ma da di 10dam cho toi khi di duoc 20dam> #1. P(x>20)> 1-pexp(20,1/20)[1] 0.3678794> #2.P(X>=30|x>10)> (1-pexp(30,1/20))/(1-pexp(10,1/20))

    [1] 0.3678794>