Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Take Home Exam 2 - Survey of Information Technology | CSIS 116, Exams of Computer Science

Material Type: Exam; Class: Survey of Info Technology; Subject: Computer Science; University: Siena College; Term: Fall 2003;

Typology: Exams

Pre 2010

Uploaded on 08/09/2009

koofers-user-g6z
koofers-user-g6z 🇺🇸

10 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSIS-116 Exam 2 (Take Home)
Name:_____________________________________________________
Using a Huffman-coding-like scheme compress the following text:
beth_beyer_buys_brueggers_bagels
Show your solution by answering the following questions:
First, how many bits would it take to store the text message without using compression?
Answer ___________bits
Next, list each symbol in descending order of frequency (most frequent to least frequent)
Symbol Frequency
e 6
b 5
_ 4
g 3
r 3
s 3
y 2
u 2
l 1
a 1
t 1
h 1
Use the following tree and pick the most appropriate encoding for each symbol. Note: there are
several correct ways to pick the encoding such that the original message is efficiently
compressed. Just try not to pick an inefficient encoding.
What binary encoding did you select for the symbol ‘e’
Answer 0
What binary encoding did you
select for the symbol ‘a’
Any 6 digit encoding
Using the coding you
selected, how many bits
will it take to store the
compressed message?
Answer 125 bits
10
10
10
10
0 1
0101
010101
0 1
e
b
_
g r s
y u l a t h
pf3
pf4
pf5
pf8

Partial preview of the text

Download Take Home Exam 2 - Survey of Information Technology | CSIS 116 and more Exams Computer Science in PDF only on Docsity!

Name:_____________________________________________________ Using a Huffman-coding-like scheme compress the following text: beth_beyer_buys_brueggers_bagels Show your solution by answering the following questions: First, how many bits would it take to store the text message without using compression? Answer ___________bits Next, list each symbol in descending order of frequency (most frequent to least frequent) Symbol Frequency e 6 b 5 _ 4 g 3 r 3 s 3 y 2 u 2 l 1 a 1 t 1 h 1 Use the following tree and pick the most appropriate encoding for each symbol. Note: there are several correct ways to pick the encoding such that the original message is efficiently compressed. Just try not to pick an inefficient encoding. What binary encoding did you select for the symbol ‘e’ Answer 0 What binary encoding did you select for the symbol ‘a’ Any 6 digit encoding Using the coding you selected, how many bits will it take to store the compressed message? Answer 125 bits

0 1 0 1 0 1 0 1 0 1 0 1 e b _ g r s y u l a t h

Name:_____________________________________________________ Give an example of a general scenario where a text file can not be compressed? If the symbol counts are uniform If the file contains all 256 ascii symbols If the file is very small, encoding the tree will take up more space than the compressed file Given the following encoding tree, encode the following message? she_sells Show the binary encoding in the table below: 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 0 Is this the tree above the most efficient way to encode the following message? she_sells_sea_shells_at_the_sea Obviously the answer is no! Suggest at least one change to the tree that would make the encoding more efficient. For extra credit, instead of suggesting one change, try drawing a more efficient encoding tree below. The ‘e’ and the ‘h’ should be swapped.

s h l a e (^) o t _

Name:_____________________________________________________ Given the following code: function MsgBox (textstring) { alert (textstring); } MsgBox is (a) A Function Name (b) A Variable (c) Both (d) Neither (Circle one answer) alert is (a) A Function Name (b) A Variable (c) Both (d) Neither (Circle one answer) textstring (a) A Function Name (b) A Variable (c) Both (d) Neither (Circle one answer) Write the html code to create two buttons. The first button is named “okbutton” and should look like this: The second button is named “cancelbutton” and should look like this: When the okbutton is clicked the function “doit( )” should be called. When the cancelbutton is cliced the function “stopit( )” should be called. Note you only need to write the two HTML tags that create the two buttons. Answer:

Name:_____________________________________________________ Give examples of at least five different methods that were used in lab 8

  1. alert
  2. write
  3. writeln
  4. open
  5. close Give examples of at least three different events that can affect a form object such as a button or a textbox 1. onClick 2. onFocus 3. onBlur Write a form and a JavaScript program that allows a user to type their first name, last name, and age, and then warns them (with an alert message) that they “must be 18 or older to apply online.” Obviously, you’ll need three text boxes and one button. The button should trigger a function which checks to see if the value typed as the age is less than 18. You’ll need to pass the value of the “age” textbox into the function. Answer: **
**

Name:_____________________________________________________

  1. Assuming that each pixel is encoded as a sequence of bits. What is the minimum number of bits that would be required to store an entire image with a resolution of 800 x 600 with 10 million possible colors for each pixel? Answer 800 X 600 X 24 bits = 11,520,000 bits 223 = 8 million 224 = 16 million 23 bits is not enough to represent 10 million colors. Thus, 24 bits is minimum number of bits needed to represent 10 million colors How many bytes is that? 11,520,000 bits/8 = 1,440,000 bytes How many megabytes is that? 1,440,000/1,000,000 = 1.44 MB
  2. What if the actual picture only contains 256 different colors? Then, what is the minimum number of bytes required to store the entire image (800 x 600)? Answer 800 X 600 X 8 bits = 3,840,000 bits = 480,000 bytes = 0.48 MB

Name:_____________________________________________________ Describe the basic difference between Client-side processing vs. Server-side processing. In client side processing, the user’s computer actually performs the work. The raw data is sent to the user’s computers, and the user’s computer does the work to produce a finished document. In server side processing, the server (web server or application server) performs the processing. The finished information (usually a webpage) is transmitted to the user. Describe the advantages of using client-side processing in terms of efficiency? Client-side processing doesn’t bog down the server with processing for multiple users. For a site like ebay there could be millions of users connected at one time. Describe a basic scenario or example where server-side processing is necessary. Server-side processing is absolutely required for retrieving data from a central database, or for updating global information (i.e., information available for all users).