homework4参考答案

上传人:仙*** 文档编号:151602944 上传时间:2022-09-13 格式:DOC 页数:6 大小:50KB
返回 下载 相关 举报
homework4参考答案_第1页
第1页 / 共6页
homework4参考答案_第2页
第2页 / 共6页
homework4参考答案_第3页
第3页 / 共6页
点击查看更多>>
资源描述
Exercise 2Question 4. File CompressionIn this section, you will use a compression algorithm to compress a message. Then you will use a compression application to determine the properties of compression.a. How does dictionary-based compression work?How does dictionary-based compression work? As knows, all text files all make up of many words, and there must be repetition among these words, while these words occupy many bytes. So, we can make something what looks like dictionary; put this “dictionary” in the head of the file, which compressed from the source file. In this dictionary, we use one emblem to replace those words, which appear continually in the file. By this way, we can get one new file which occupies fewer bytes than the old one, at the same time, the content of the file would not be destroyed. When we need use this file to get the source one, we could seek the dictionary, and get the source file. So, it was the ancestor of the lossless compression.Use dictionary-based compression to compress the message below:sea shells, sea horses, and seals are in the sea. For example: “#” expresses “sea”, so the message can be expressed by this new message: # shells, # horses, and #ls are in the #.b. How many bytes does the message above contain (each character is 1 byte including spaces)? The message above contains 49 bytesc. Create a compression dictionary and calculate its size in bytes. Dictionary: #sea, 4 bytes.d. What is the compressed message? The compressed message is “# shells, # horses, and #ls are in the #.”e. How many bytes did the entire compression use? The entire compression use 45 bytes.f. Is dictionary-based compression a lossy compression? Explain. No, dictionary-based compression is not a lossy compression. Because by this compression, during we compress the source massage, we use the single emblem to replace the repetition, while we resume or uncompress the message, we should replace the emblem with the repetition, so it wont destroy the file.Copy and paste the entire content of this exercise into Notepad and save it as compress0.txt Compress this file using WinZip or any compression application and name it compress1.zip. If you do not have WinZip application installed on your computer, refer to Appendix B. Downloading WinZip Appendix for directions to download the application. g. What is the size of the file before and after compression? What is the compression ratio of compress1.zip to the original file? The size of the file before is 8K, and it is 4K after compression. The compression ratio is 2:1Compress compress1.zip and name it compress2.zip. h. What is the compression ratio of compress2.zip to compress1.zip? Explain what is happening. (Hint: think of information that needs to be stored for a compression.) The compression ratio is 3.04:3.11. Because compress1.zip has be compressed, there is no space to be recompressed, on the other, the new compress file-compress2.zip contains more massage used to compress, such as dictionary, so the ratio of them become bigger, it is unnecessary to compress the file be compressed, especially the text file.i. Is this a lossy or lossless compression? What do you think would happen if you kept on compressing the file successively? This is a lossless compression. Is I kept on compressing the file, the compression ratio should become bigger and bigger, the new compression file should occupy more space.j. Is lossy compression appropriate for compressing images? Is it appropriate for hard disk backups? Provide explanations for both parts. Lossy compression is appropriate for compressing images, because in the images, there are some details should not to be adverted, on the other hand, naked eye cant distinguish many details, such as boundary, the color with high resolution ratio. But it isnt appropriate for hard disk backups, because the files in the hard disk , must to be uncompressed if necessary, with none changes and destroyed. This kinks of file must be compress by lossless compression.Unit 1 and Unit 2 Review Materials4. Compression a. What is compression? Compression is the process of reducing file sizes by removing redundant data expressions and replacing them with smaller ones.b. Describe a benefit of compression. Compression reduces file sizes, which makes it easier to transmit data over a network, as an examplec. Describe dictionary-based compression. Dictionary-based compression replaces sequences of characters that appear frequently with a single codeword, or symbol. The mapping between the codeword and the original sequence of characters is stored in a dictionary.d. Describe run-length encoding. Run-length encoding(运行长度编码) is a compression style used with graphics files. Patterns of pixels are replaced by information that describes the pattern. For instance, instead of 100 consecutive bytes of data, representing 100 white pixels, run-length encoding replaces this data with two bytes: the first represents the number of pixels, the second the color.e. Describe a benefit of lossy compression. The benefit of lossy compression is that data that is undiscernible to the human eye or ear is removed, which decreases the file size without removing data that is important.f. Name a file type that incorporates lossy compressionJPG, MP3, as examples.7.Images a. How are bitmapped images rendered? Bitmapped images are rendered by interpreting the value for each given pixel. The size of a bitmapped image is fixed and when rendered each pixel is mapped out to have a given value.b. How are vectored images rendered? Vector images use mathematical calculations to compute the image. In other words, the image creates geometric shapes that are computed and drawn as the image is rendered.c. Which image type tends to be more photo-like in quality, bitmapped or vectored? Bitmapped.d. Which image type maintains a high image quality, regardless of how it is resized? Vector.e. List three image editors. Adobe Photoshop, Microsoft Image Composer, Adobe Illustrator9. Magnetic Media a. List two advantages of magnetic media over optical media. As an example, magnetic media is less expensive. As an example, faster for writing data. As an example, magnetic media provides higher capacities.b. Fill in the following chart matching the type of media with its storage capacity. The types of media to choose from are Jaz disk, Zip disk, hard disk drive, high-density floppy disk, and double density floppy disk.Type of MediaStorage CapacityDouble Density Floppy Disk720 KBHigh Density Floppy Disk1.44 MBZip Disk100 MB or 250 MBJaz Disk1 GB or 2 GBHard Disk Drive (current size)20-80 GBc. Consider that magnetic media is read by an electromagnet. How does the read/write head discern and transfer data from the magnetic media to the system? The read-write head uses a weak electro-magnetic force to read data, and a stronger electro-magnetic force to change the orientation of the magnetic particle, assigning orientations that correspond to 1s and 0s. The particles polar alignment determines the data that a given bit holds.10.Moores Law a. Define Moores Law. The number of transistors on a microchip will double every 18 months, until physical limitations are reachedb. List two extrapolations of Moores Law that are discussed in the course materials. RAM storage capacity doubles every 18 months. Processor speeds double every 18 months.c. How can Moores Law and the extrapolations from Moores Law assist a consumer in purchasing a computer? Moores Law and its extrapolations offer the consumer the ability to plan for future upgrades and determine the lifespan of a given system, allowing the consumer to determine the best way to maximize their purchase with respect to the computers power and lifespan.d. Define Parkinsons Law of Data. Data expands to fill the space available. e. Using Parkinsons Law, what projection can be made regarding memory and hard disk usage? According to Parkinsons Law of Data, the space in memory will be used if it is available. In other words, as industry develops media with greater storage capacities, data and software will increase in size to fill them. (We will never have “too much” memory or disk storage.)f. How can Parkinsons Law assist a consumer in purchasing software or components for a computer? Parkinsons Law of Data can help a consumer purchases a computer system, knowing that storage capacities are always increasing, and the data to fill it will increase proportionally. The consumer can estimate how much storage space is necessary now and in the future.11. Optical Media a. List two advantages of optical media over magnetic media. Optical is more resistant to environmental effects, as an example. Optical is has a longer lifespan (less chance of decay), as an example.b. Fill in the following chart. The types of media to choose from are CD-R, CD-RW, CD-ROM, and DVD-ROM.Type of MediaStorage CapacityNumber of Times It Can Be Written ToCD-ROM650-700 MB0CD-R650-700 MB1CD-RW650-700 MBunlimitedDVD-ROM4.7 GB0c. Consider that optical media is read by a laser. How does the laser discern and transfer data from the optical media to the system? The laser deciphers light and dark spots to create a stream of digital information. The light is reflected by the media and a light sensor reads the reflected light.d. Consider that a DVD and a CD are the same size. List two reasons a DVD holds more information than a CD. The color of laser used by the DVD is narrower, allowing the tracks to be closer together. DVDs are layered allowing more data to be record on the same area at different depths.
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 管理文书 > 施工组织


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!