Textbook Notes (369,035)
United States (206,160)
Chapter

CS Practice Problems 1

2 Pages
69 Views
Unlock Document

Department
Computer Science
Course
CAS CS 101
Professor
David Shim
Semester
Fall

Description
Julia Buckley CS HW #1 Professor Raisin 10.28.13 Problem 1. Numbers as bits a) 2  or 2,147,483,648 is the largest amount of seconds that can be represented because  there are two choices for every bit, 0 and31. 31,536,000 seconds= 1 year, therefore 2  divided by the # of seconds in a year is 68.1  years, therefore if 68 years are added to 1970, then in 2038, 31 bits will not be enough. b) Coins are going to have different values given as powers of 2. The goal is to give  customers the minimum number of coins, only giving them one or none of each type of  coin. Choose the largest valued coin under the value of change you need to give back.  Next, based on the value of the remainder, choose the largest number value coin under  the remainder. Keep doing this process until you end up with 0 as your remainder. This is  the minimum amount of coins that can be given.  Problem 2. Pictures as bits 3 a) A 256­color image takes 24 bits, because of the multiplication principle, 256 =  16,777,216 and the log  2f this number is 24. These equations are used because there are  256 choices or shades, and in order for a color to be made three shades must be chosen  (multiplication principle). Also, the log must be taken of this new number because that  gives you the number of bits. b) You can represent 4,096 colors because 4 bits means that there are 16 shades because of  the following formula= 2 =N. 16 shades by multiplication principle becomes 4,096  colors. c) We h
More Less

Related notes for CAS CS 101

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit