CPSC 121 Study Guide - Final Guide: Surjective Function, Brie, Perfect Number

96 views6 pages
24 Oct 2018
School
Course
Professor
lillyzuxian and 39077 others unlocked
CPSC 121 Full Course Notes
38
CPSC 121 Full Course Notes
Verified Note
38 documents

Document Summary

Explain brie y the di erence between the purpose of a half-adder and that of a full- adder. Solution : a half-adder computes the sum of two bits. A full-adder adds three bits (two bits and a carry from a previous position). Give an example of a function f from z+ into a that is not onto (surjective). Solution : the function f de ned by f (x) = 1 is not onto (there is no positive integer x such that f (x) = 2). Consider the function f : {1, 2, . , 18} a de ned by f (x) = x2 3x + 3. Solution : no, because f (1) = f (2) = 1. Solution : 256 + 32 + 16 + 8 + 2 + 1 = 197. 1. 2000002 page 2 (and so on) instead of. Solution : the value 0. 1 can not be represented exactly as a (binary) oating point value.