Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Discrete Structures ICS-252 Dr. Ahmed Youssef 1.

Similar presentations


Presentation on theme: "1 Discrete Structures ICS-252 Dr. Ahmed Youssef 1."— Presentation transcript:

1 1 Discrete Structures ICS-252 Dr. Ahmed Youssef 1

2 References –Discrete Mathematics and its Applications Kenneth Rosen –Lecture Notes. 2

3 Discrete Structures Definition Discrete structure deals with discrete objects. Discrete objects are those which are separated from (not connected) each other. Examples: Integers (whole numbers 5, 10, 15) Automobiles, houses, people etc. are all discrete objects. On the other hand real numbers (such as 5.35, 5.2345) are not discrete. 3

4 Importance of Discrete Structures It provides foundation material for computer science. It includes important material from such areas as set theory, logic, and graph theory. The graph theory concepts are used in networks, operating systems, and compilers. Set theory concepts are used in software engineering and in databases. In engineering, It can be used to control multiproduct batch plants, and design of a new class of simulator. 4

5 Representations of Integers 5

6 Number Theory It is the branch of pure mathematics concerned with the properties of numbers in general, and integers in particular. Number Theory Areas: Elementary number theory-Study of Integers. Analytic number theory-employs the machinery of calculus and complex analysis to tackle questions about integers. 6

7 7

8 # Computers usually use binary notation (with 2 as the base) when carrying out arithmetic. # Computers usually use octal (base 8) or hexadecimal (base 16) notation when expressing characters such as letters or digits. Introduction # The binary digits are: 0 and 1. # The octal digits are: 0, 1, 2, 3, 4, 5, 6, and 7. # The decimal digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. # The hexadecimal digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. 8

9 9 Decimal System b-base System b=2  binary b=8  octal b=16  hexadecimal

10 Theorem: Let b be a positive integer greater than 1. Then if n is a positive integer, it can be expressed uniquely in the form n = a k b k + a k-1 b k-1 +…+a 1 b + a 0 where k is a nonnegative integer, a 0, a 1,…, a k are nonnegative Integers less than b and a k ≠0. Base b expansion of n The base b expansion of n is denoted by: (a k a k-1 …a 1 a 0 ) Remarks: This theorem is used to convert the number from any b-base to decimal-base. 10

11 Example : What is the decimal expansion of the hexadecimal expansion of (2AE0B) 16 Sol: we will use the expansion n = a k b k + a k-1 b k-1 +…+a 1 b + a 0 where b=16 (2AE0B) 16 =2 x 16 4 + 10 x 16 3 + 14 x 16 2 + 0 x16 +11 =(175627) 10 11

12 Example : What is the decimal expansion of the binary expansion of (101011111) 2 Sol: we will use the expansion n = a k b k + a k-1 b k-1 +…+a 1 b + a 0 where b=2 (101011111) 2 =1 x 2 8 + 0 x 2 7 + 1 x 2 6 + 0 x 2 5 + 1 x 2 4 + 1 x 2 3 + 1 x 2 2 + 1 x 2 + 1 x 2 0 =(351) 10 12

13 Example : Find the base 8 expansion of (12345) 10 12345 = 8 x 1543 + 1 812345 815431 81927 8240 830 03 1543 = 8 x 192 + 7 192 = 8 x 24 + 0 24 = 8 x 3 + 0 3 = 8 x 0 + 3 (12345) 10 =(30071) 8 13

14 Example : Find the base 2 expansion of (241) 10 2241 21201 2600 2300 2150 271 231 211 01 (241) 10 =(11110001) 2 14

15 1.Convert these integers from decimal to: binary; octal; and hexadecimal. (a) 203 (b) 4532 (c) 97644 2. Convert these integers from base b to decimal number. (a) (11011) 2 (b) (80E) 16 (c) (7345321) 8 15

16 16 nOctalHexadecimal 00000000 10010001 20100010 30110011 41000100 51010101 61100110 71110111 81000 91001 A1010 B1011 C1100 D1101 E1110 F1111 To convert a binary number to octal or hexadecimal numbers.

17 Example : What is the hexadecimal expansion of the binary expansion of (101011111) 2 Sol: (101011111) 2 = (0001 0101 1111) 2 =(15F) 16 17 Example : What is the octa expansion of the binary expansion of (101011111) 2 Sol: (101011111) 2 = (101 011 111) 2 =(537) 8

18 Example : What is the binary expansion of the (A10D) 16 Sol: (A10D) 16 =(1010000100001101) 2 18 Example : What is the binary expansion of (537) 8 Sol: (537) 8 = (101 011 111) 2

19 Find the octal and hexadecimal expansions of (11 1110 1011 1100) 2 Find the binary expansions of (765) 8 and (A8D) 16. 19

20 20


Download ppt "1 Discrete Structures ICS-252 Dr. Ahmed Youssef 1."

Similar presentations


Ads by Google