First time job

Source: Internet
Author: User

One

1-1 Compressed Data volume

1-2 reduce the use of space, reduce information storage space, improve its transmission, storage and processing efficiency

1-6 according to the reversibility of the compression process classification, can be divided into lossless compression and lossy compression.

According to the principle of compression can be divided into: Predictive coding, Transformation coding, quantization and vector quantization coding, information entropy coding, sub-band coding, model coding.

Ii. Reference book "Introduction to Data Compression (4th edition)" Page 8

1-4 1. doc, TXT, SQL database and other files, compression ratio will be very large, but like Jpg,mp3 and so on itself is the compressed format of digital audio or picture files, compression out of the proportion is not much

2. Redundancy is to characterize the source information rate of excess, is to describe the source statistical characteristics of a physical quantity, we can not quantify the redundancy of the discussion

Three

3.

(a) since P (A1) =p (A2) =p (A3) =p (A4) =1/4,

H=-1/4*4*log21/4

=-LOG21/4

= log24=2 (BITS)

(b) h=-(1/2*LOG21/2+1/4*LOG21/4+1/8*LOG21/8+1/8*LOG21/8)

=-1/2*LOG21/2-1/4*LOG21/4-1/8*LOG21/8-1/8*LOG21/8)

=1/2+1/2+3/8+3/8=7/4

(c) h=-(0.505*log20.505+1/4*log21/4+1/8*log21/8+0.12*log20.12)

=-0.505*log20.505-1/4*log21/4-1/8*log21/8-0.12*log20.12

=-0.505*log20.505+1/2+3/8-0.12*log20.12

5.

(a) There is a total of 84 letters, a appears 21 times, C appears in the number of occurrences of 24,g 16 times, T appears 23 times, then

P (A) =21/84=1/4,p (C) =24/84=2/7,p (G) =16/84=4/21,

P (T) =23/84

h=-(1/4*LOG21/4+2/7*LOG22/7+4/21*LOG24/21+23/84*LOG223/84)

=-1/4*log21/4-2/7*log22/7-4/21*log24/21-23/84*log223/84

=2 (BITS)

7.

#include <iostream>
#include <iomanip>
#include <ctime>

using namespace Std;

int main ()
{
int p,i,j;
Char m[100][100];
Srand (Time (NULL));
Cout<<setfill (' 0 ');
for (i=0;i<100;i++)
{
for (j=0;j<4;j++)
{
P=rand ()%26;
M[i][j]=p+ ' a ';
}
m[i][4]= ' + ';
cout
<< "" <<m[i]<< "\ T";
}
return 0;
}

First time job

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.