




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、概率論第二次試驗報告 姓 名 楊帆學 號:4012014057姓 名 楊藍學 號:4012014025姓 名 張藝朋學 號:4012014047123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899010203040506070809101112131415161718192
2、021222324252627282930313233343536 #正態(tài)分布#第一問curve(dnorm(x,mean = -2,sd=1,log=FALSE),type = "l",add = TRUE,xlim=c(-5,5),ylim=c(0,1),ylab = "概率")curve(dnorm(x,mean = 0,sd=1,log=FALSE),type = "l",add = TRUE,col="red")curve(dnorm(x,mean = 2,sd=1,log=FALSE),type = &
3、quot;l",add = TRUE,col="green")curve(pnorm(x,mean = -2,sd=1),type = "l",add = TRUE)curve(pnorm(x,mean = 0,sd=1,lower.tail = TRUE,log.p = FALSE),type = "l",add = TRUE,col="red")curve(pnorm(x,mean = 2,sd=1,lower.tail = TRUE,log.p = FALSE),type = "l&quo
4、t;,add = TRUE,col="green")title(main = "正態(tài)分布")mtext("-單調(diào)的是分布函數(shù)", adj = 1,line = -1)mtext("-不單調(diào)的是概率密度", adj = 1, line = -2)text(x=-3,y=0.6,labels="= -2")text(x=-1,y=0.6,labels="= 0",col="red")text(x=1,y=0.6,labels="= -2",
5、col="green")#第二問curve(dnorm(x,mean = 0,sd=0.5,log=FALSE),type = "l",add = TRUE,lwd=4,xlim=c(-5,5),ylim=c(0,1),ylab = "概率")curve(dnorm(x,mean = 0,sd=1,log=FALSE),type = "l",add = TRUE,col="red")curve(dnorm(x,mean = 0,sd=2,log=FALSE),type = "l&quo
6、t;,add = TRUE,col="green")curve(pnorm(x,mean = 0,sd=0.5),type = "l",add = TRUE)curve(pnorm(x,mean = 0,sd=1,lower.tail = TRUE,log.p = FALSE),type = "l",add = TRUE,col="red")curve(pnorm(x,mean = 0,sd=2,lower.tail = TRUE,log.p = FALSE),type = "l",add =
7、TRUE,col="green")title(main = "正態(tài)分布")mtext("-單調(diào)的是分布函數(shù)", adj = 1,line = -1)mtext("-不單調(diào)的是概率密度", adj = 1, line = -2)text(x=-3,y=0.6,labels="= -2")text(x=-1,y=0.6,labels="= 0",col="red")text(x=1,y=0.6,labels="= -2",col="
8、;green")#泊松分布x<-seq(0,30)plot(x,dpois(x,1),type="b")lines(x,dpois(x,2),type="b",col="red")lines(x,dpois(x,3),type="b",col="green")lines(x,dpois(x,6),type="b",col="blue")#二項分布p<-0.2x<-seq(0, n, by = 1)f= choose(10,x)
9、* px * (1-p)(10-x) p= choose(20,x) * px * (1-p)(20-x) g= choose(50,x) * px * (1-p)(50-x) plot(x,g, type = "l", ylab = "p(x)",main = "二項分布概率分布圖")lines(x,p, col = "red", lwd = 2)lines(x,f, col = "green", lwd = 2)mtext("f = choose(n,x) * px * (1-p)
10、(n-x) ", adj = 0)mtext("最大概率", adj = 0, line = -1, font = 4)#二項分布的泊松逼近x <- seq(0, 40, 1)plot(x,dbinom(x, size=40,prob=0.2, log = FALSE), type = "p", ylab = "F(x)", main = "二項分布的泊松逼近")curve(dpois(x,lambda = 8, log = FALSE),type = "p",col="
11、;red",ylim=c(0,1), xlim=c(0,10),add = TRUE)mtext("-二項分布B(k;40,0.2) ", adj = 1,line = -1)mtext("-泊松分布(8) ", adj = 1, line = -2,col="red")#服務窗口問題#m_plot<-array(0,dim = c(1:15)#m_x<-array(0,dim = c(1:15)a<-0b<-0p<-0.1n<-200 #ns<-3 #s為排隊人數(shù)shiyan_nu
12、m<-1000alpha<-0.8 for (m in 1:15) b=0 for (j in 1:shiyan_num) a=0 for (i in 1:n) x=rbinom(1,1,p) if(x=1) a=a+1Z if(a<=m*s) b=b+1 # m_plot1,m<-b/shiyan_num print(b/shiyan_num)#plot(m_x1, ,m_plot1, )#高爾頓釘板實驗n<-5000zhixing<-function(p =0.3,Vector=1:n) Count.location=seq(from=0,to=0,le
13、ngth.out=length(Vector) j<-1 for(i in Vector) path<-sample(c(-1,1),20,replace=TRUE,prob=c(p,1-p)#用-1表示左走,用1表示右走 location<-sum(path) #location代表球向左或向右走|location|步 Count.locationj<-location j<-j+1 hist(Count.location,xlim=c(-20,20),ylim=c(1,2000), main = "高爾頓釘板實驗",ylab="出
14、現(xiàn)的次數(shù)",xlab="球的位置")#畫出直方圖zhixing(p=0.15) #分別執(zhí)行p=0.5,p=0.85#zhixing(p=0.5)#zhixing(p=0.85)zhixing<-function(p =0.3,Vector=1:5000) Count.location=seq(from=0,to=0,length.out=length(Vector) j<-1 for(i in Vector) path<-sample(c(-1,1),20,replace=TRUE,prob=c(p,1-p)#用-1表示左走,用1表示右走 location<-sum(path) #location代表球向左或向右走|location|步 Count.locationj<-location j<-j+1 hist(Count.location,xlim=c(-20,20),ylim=c(1,2000), main = "高爾頓釘板實驗",ylab="出現(xiàn)的次數(shù)",xlab="球的位置")#畫出直方圖 zhixing(Vector=1:
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 江西省贛州市尋烏縣博豪中學2024-2025學年高二下學期第一次階段性檢測語文答案
- 賀州學院《國際商務禮儀》2023-2024學年第二學期期末試卷
- 舞蹈聯(lián)考筆試試題及答案
- 知名心理測試試題及答案
- 城市旅游發(fā)展總體規(guī)劃案例分析
- 鐵路養(yǎng)護工考試題及答案
- 長豐幼教面試試題及答案
- 長沙導游面試試題及答案
- 跳繩軟件測試試題及答案
- 2025年內(nèi)鏡專用高頻電刀項目發(fā)展計劃
- 建設工程項目施工安全管理流程圖
- 意識障礙的判斷PPT精選文檔
- (完整版)質量目標細化分解方案-橋梁工程
- 海康威視槍機攝像機檢測報告
- 擺線針輪減速機型號及其對照表選型表
- 工程EPC總承包采購方案說明
- 財務用發(fā)票分割單范本
- 風電機組現(xiàn)場吊裝記錄
- STC550T(55t、46m)(三一重工)汽車起重機使用說明書
- 高等院校應屆畢業(yè)生就業(yè)推薦表
- 物理12實驗:探究小車速度隨時間變化的規(guī)律
評論
0/150
提交評論