freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

信息論與編碼實(shí)驗(yàn)指導(dǎo)書-在線瀏覽

2025-08-10 18:09本頁面
  

【正文】 out聯(lián)合熵H(X,Y)計算:endl。 int r,u,h=0。k4。n4。 } else { r=k,u=n。 break。 else coutP(r+1,u+1)為零,中斷,無值endl。 b=0,h=0。k4。 for(n=0。n++) { i+=(a[k][n]/t)。n4。 } else {h=1。} } } if (h==0){coutH(X|Y)=∑∑P(X,Y)log(P(X,Y)/P(Y))=bendl。 coutI(X|Y)計算:endl。 else coutP(r+1,u+1)為零,中斷,無值endl。3 實(shí)驗(yàn)數(shù)據(jù)與實(shí)驗(yàn)結(jié)果這里設(shè)定函數(shù)為4行4列的隨機(jī)矩陣。而H(X)、H(Y)、H(X,Y)H(X|Y)、I(X|Y)就根據(jù)課本上的公式,然后編程。void main(){ int k,n,t=0。 srand((unsigned)time(NULL))。k4。n4。 t+=a[k][n]。 for(k=0。k++) { for(n=0。n++) { coutsetw(5)a[k][n]。 } cout函數(shù)歸一化:endl。k4。n4。 } coutendl。 int e=1。k4。 for(n=0。n++) { i+=(a[k][n]/t)。 } coutP(Yk+1):isetw(8)P(Xe):gendl。 b=(i*log(i)/log())。 } coutH(Y)=∑p(Y)log p(Y)=bendl。 cout聯(lián)合熵H(X,Y)計算:endl。 int r,u,h=0。k4。n4。 } else { r=k,u=n。 break。 else coutP(r+1,u+1)為零,中斷,無值endl。 b=0,h=0。k4。 for(n=0。n++) { i+=(a[k][n]/t)。n4。 } else {h=1。} } } if (h==0){coutH(X|Y)=∑∑P(X,Y)log(P(X,Y)/P(Y))=bendl。 coutI(X|Y)計算:endl。 else coutP(r+1,u+1)為零,中斷,無值endl。[實(shí)驗(yàn)學(xué)時]2學(xué)時[實(shí)驗(yàn)準(zhǔn)備]1.熟悉離散信源的編碼方法,重點(diǎn)是Huffman編碼方法,設(shè)計Huffman編碼的數(shù)據(jù)結(jié)構(gòu)和算法;2.編寫Huffman編碼的書面程序代碼。附實(shí)驗(yàn)二實(shí)驗(yàn)內(nèi)容及程序源程序?qū)嶒?yàn)二 離散信源的Huffman編、譯碼方法1 實(shí)驗(yàn)內(nèi)容(1)利用random函數(shù)構(gòu)造一個一維離散隨機(jī)變量分布P(X);(2)根據(jù)概率壓縮表構(gòu)造Huffman編碼表,并實(shí)現(xiàn)Huffman編碼;(3)完成Huffman譯碼;2 數(shù)據(jù)結(jié)構(gòu)與算法描述 (1)函數(shù)的定義:函數(shù)的數(shù)據(jù)成員 :void aa(int n){ double w=0。 srand((unsigned)time(NULL))。 for(int i=0。i++) { a[i]=rand()%50。 } for(int i=0。i++) { a[i]=a[i]/w。 for(int i=0。i++) { for(int j=n2。j) { if(a[j]a[j+1]) { p=a[j+1]。 a[j]=p。 for(int i=0。i++) { (3)。 }} 2. Huffman譯碼函數(shù)代碼:void huffman(double *a,string *c,int n){ elem mp。 double *b。for(int i=0。i++){b[i]=a[i]。d=new double[n]。in。} double *e。for(int i=0。i++){e[i]=i。 for(int m=n。m) { b[m2]+=b[m1]。=d[m1]。 double mp,mp1。in1。j=i。 mp1=d[j+1]。 d[j+1]=d[j]。d[j]=mp1。 for(int i=0。i++) { (3)。 } } while(!()) { mp=()。in。 } } for(int i=0。i++) { if(==e[i]) { c[i]=t。 } else if(==e[i]) { c[i]=t。 } } } } (2)主函數(shù)main() 實(shí)現(xiàn)初始化操作,完成對子函數(shù)的調(diào)用void main(){ int n。 cinn。 aa(n)。 coutendl。 for(int i=0。i++) { (3)。 (0)。 coutendl。 實(shí)驗(yàn)結(jié)果:4 程序代碼清單:includeincludecstdioincludeiomanipincludeincludecassertincludestringincludeiostreamusing namespace std。string *c。 double a3。class stack{ int size。 elem *list。top=0。} ~stack(){delete []list。} void push(const elemamp。list[top++]=item。return list[top]。return list[top1]。}}。 a=new double[n]。 cout隨機(jī)生成歸一化一維離散變量:endl。in。 w+=a[i]。in。 } double p。in1。j=i。 a[j+1]=a[j]。 } }
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1