CSCI 150, Spring 2003

Home | | Course Schedule | | Assignments | | Lecture Notes

Review sheet soluutions for Final Exam

Solutions to Practice Problems
The following problems are intended to help you study for the exam. In addition, you should review the problems from the first two review sheets, along with your homework and labs.

1. Use the web page screen shot given in Figure 1 to answer the following questions. This shot was taken when the mouse was over the link.

Figure 1. Screen shot of web page for problem 1

2. The following equations give the running times (t) of different algorithms with respect to the size of the input (n). For each, state whether the problem is tractable or intractable:

3. The following table gives the running time of an algorithm for different input sizes:

	Size	time(secs)
	1		0.5
	2		2.0
	3		4.5
	4		8
	5		12.5
	...		...
	10		50
	100		5000

4. Protocols.

5. What color does #FF00FF represent in the RGB color representation?

Answer: Purple

6. Suppose an image file has a bit depth of 8, a width of 100 pixels and a height of 200 pixels.

7. Briefly describe what "packet switching" means and how it is used on the internet.

Answer: Packet switching is the process in which email messages are broken up into small "packets". Each packet is sent separately across the internet (and they may take separate routes to their destination).

8. Describe how we know that some functions are non-computable. Describe 2 problems that are non-computable.

Answer: Functions are not a countable set, but programs are a countable set. So if we pair up each program with a function, there will always be functions left over. These are the non-computable functions.

9. Suppose you want to prove that a given problem was non-computable with a proof by contradiction. What are the 2 steps you must accomplish for such a proof?

Answer: 1)Assume the program to solve the problem exists.

2) Show that this assumption leads to impossible consequences.

10. Write an assembly language (P88 instructions) to read in two numbers. If the first is bigger, it should print out the first number. Otherwise the program should print nothing and end.

Answer:

11. Write a pascal program to read in integers into an array until a -1 is entered. Count the number of 2's entered and print out the result.

Answer: