math 170 project part 2 by: marlene reyna and guadalupe esquivel section 4.6#33 section 9.3#29...

16
Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6 #33 Section 9.3 #29 Section 9.6 #18

Upload: ross-bennett

Post on 02-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Math 170 Project Part 2

By: Marlene Reyna and Guadalupe Esquivel

Section 4.6 #33Section 9.3 #29Section 9.6 #18

Page 2: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

• He was born in 276 BC in Shahhat, Libya.

• He was a Greek mathematician, geographer and astronomer.

• In number theory, he introduced the sieve of Eratosthenes, an efficient method of identifying prime numbers.

• He died in 194 BC in Alexandria, Egypt.

Section 4.6 #33

Eratosthenes

Page 3: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Section 4.6 #33The sieve of Eratosthenes provides a way to find all prime numbers less than or equal

to some fixed number n. To construct it, write out all the integers from 2 to n. Cross out all multiples of 2 except 2 itself, then all multiples of 3 except 3 itself, then all multiples of 5 except 5 itself, and so forth. Continue crossing out the multiples of each successive prime number up to √n. The numbers that are not crossed out are all the prime numbers from 2 to n.

Here is a sieve of Eratosthenes that includes the numbers from 2 to 27. The multiples of 2 are crossed out with a /, the multiples of 3 with a \, and the multiples of 5 with a —.

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

Page 4: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Use the sieve of Eratosthenes to find all prime numbers lessthan 100

1 2 3 5 7 9 21 23 25 27 2931 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99

Without multiples of 7 and 11

Without multiples of 2 Without multiples of 3 and 5

1 2 3 5 711 13 17 19 23 29 31 37 41 43 47 49 53 59 61 6771 73 77 79 83 89 91 97

1 2 3 5 711 13 17 19

23 29 31 37

41 43 4753 59 61 67

71 73 79 83 89 97

Page 5: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

List of all prime numbers less than 100:

Page 6: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Section 9.3 #29 Refer to Example 9.3.5

Example 9.3.5 Internet AddressesAn example of an IP address is 10001100 11000000 00100000 10001000, where the 32 bits have been divided into four groups of 8 for easier reading. To make the readings even easier, IP addresses are normally written as “dotted decimals,” in which each group of 8 bits is converted into a decimal number between 0 and 255. For instance, the IP address above converts into 140.192.32.136.In order to accommodate the various sizes of the local networks connected through the Internet, the network IDs are divided into several classes, the most important of which are

called A, B, and C. In every class, a host ID may NOT consist of either all 0’s or all 1’s.

Class A network IDs are used for very large local networks. The left-most bit

is set to 0, and the left-most 8 bits give the full network ID. The remaining 24 bits are used

for individual host IDs. However, neither 00000000 nor 01111111 is allowed as a network ID for a class A IP address.

Page 7: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Class B network IDs are used for medium to large local

networks. The two left-most bits are set to 10, and the left-most 16 bits give the full network ID. The remaining 16 bits are used for individual host IDs.

Class C network IDs are used for small local networks. The three left-

most bits are set to 110, and the left-most 24 bits give the full network ID. The remaining 8 bits are used for individual host IDs.

Page 8: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

a. Write the following IP address in dotted decimal form:

11001010 00111000 01101011 1110111027 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20 1 1 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0

27+26+23+21 25+24+23 26+25+23+21+20

27+26+25+23+22+21

=202 =56 =107 =238

Ans: 202.56.107.238

b. How many Class A networks can there be?

The network ID for a Class A network consists of 8 bits and begins with 0. There are two choices for each of the remaining 7 positions meaning that the total number of possible network IDs is 27 but because neither 00000000 nor 01111111 is allowed, the total is reduced by 2.

Ans: 27- 2 = 128-2 = 126 possible class A networks.

Page 9: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

c. What is the dotted decimal form of the IP address for a computer in a Class A network?

Let w.x.y.z be the dotted decimal form of the IP address for a computer in a Class A network. Since neither 00000000 nor 0111111 is allowed as a network ID for a Class A IP address, the Network ID part of a Class A IP address goes from

00000001 to 01111110 .

This means that w can be any integer from 1 through 126. The remaining variables x,y,z, which correspond to the Host ID for a Class A IP address, can be any integer from:

00000000 to

11111111

However, x, y, and z can’t all be 0 or 255 since a host ID may NOT consist of either all 0’s or all 1’s.

Ans: The dotted decimal form of the IP address for a computer in a Class A network is w.x.y.z where 1≤ w ≤ 126, 0 ≤ x ≤ 255, 0 ≤ y ≤ 255, and 0 ≤ z ≤ 255. However, x,y, and z are not allowed to all be 0 or 255.

w xy z

0 to 255

1 to 126

Page 10: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

d. How many host IDs can there be for a Class A network?

For a class A network, 24 bits are used for host IDs. Having two choices (either 0 or 1) for each of 24 positions gives a total of 216 host IDs. But because two of these are NOT allowed (all 0’s and all 1’s), the total number of host IDs is 216 - 2.

e. How many class C networks can there be?

The network ID for a Class C network consists of 24 bits and begins with 110. Because there are two choices for each of the remaining 21 positions (either 0 or 1), the total number of possible network IDs is 221.

Page 11: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

f. What is the dotted decimal form of the IP address for a computer in a Class C network?

Let w.x.y.z be the dotted decimal form of the IP address for a computer in a Class C network. The network ID part of a Class C IP address goes from

11000000 00000000 00000000 192 0 0

to 11011111 11111111 11111111. 220 255 255

As dotted decimals, these numbers range from 192.0.0 to 220.255.255. This means that 192 ≤ w ≤ 220, 0 ≤ x ≤ 255, 0 ≤ y ≤ 255. Since z is the host ID, it must go from

00000001 to 11111110 since a host ID may NOT consist of either all 0’s or all 1’s. This means that 1 ≤ z ≤ 254.

Ans: w.x.y.z is the dotted decimal form of the IP address for a computer in a Class C network

where 192 ≤ w ≤ 220, 0 ≤ x ≤255, 0 ≤ y ≤ 255, and 1 ≤ z ≤ 254.

G. How many host IDs can there be for a Class C network?For a class C network, 8 bits are used for host IDs. Having two choices (either 0 or 1) for

each of 8 positions gives a total of 28 host IDs. But because two of these are NOT allowed (all 0’s and all 1’s), the total number of host IDs is 28 - 2.

= = =

= = =

w x y z

Page 12: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

h. How can you tell, by looking at the first of the four numbers in the dotted decimal form of an IP address, what kind of network the address is from? Explain.

Assume w.x.y.z is the dotted decimal form of an IP address. If 1 ≤ w ≤ 126 then that means that we are looking at a Class A network(Refer to problem C). If 192 ≤ w ≤ 220, then that means that we are looking at a Class C network (Refer to problem F). If 128 ≤ w ≤ 191 then that means that

we are looking at a Class B network since the network ID part of a Class B IP address goes from : 10000000 00000000

128 0to

10111111 11111111191 255

As dotted decimals, these numbers range from 128.0 to 191.255. This means that 128 ≤ w ≤ 191.I. An IP address is 140.192.32.136. What class of network does it come from?It comes from a Class B network since the dotted decimal form of a Class B IP address is w.x.y.z where 128 ≤ w ≤ 191.(Refer to problem h)J. An IP address is 202.56.107.238. What class of network does it come from?

It comes from a Class C network since the dotted decimal form of a Class C IP address is w.x.y.z where 192 ≤ w ≤ 220.(Refer to problem f)

= =

= =

Page 13: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

Section 9.6 #18A large pile of coins consists of pennies, nickels, dimes and quarters.

a. How many different collections of 30 coins can be chosen if there are at least 30 of each kind of coin?

b. If the pile contains only 15 quarters but at least 30 of each other coin, how many collections of 30 coins can be chosen?

c. If the pile contains only 20 dimes but at least 30 of each other coin, how many collections of 30 coins can be chosen?

d. If the pile contains only 15 quarters and only 20 dimes but at least 30 of each other coin, how many collections of 30 coins can be chosen?

Page 14: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

To solve the following problems we use combinations:C(n,k)= n = n! k (n-k)! k!

a. How many different collections of 30 coins can be chosenif there are at least 30 of each kind of coin?There are 30 pennies, 30 nickels, 30 dimes and 30 quarters.There are a total of 120 coinsC(120, 30)= 120! _

90! 30!

b. If the pile contains only 15 quarters but at least 30 of each other coin, how many collections of 30 coins can be chosen?There are a total of 105 coins in this pile.C(105,30)= 105!

75! 30!

Page 15: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

c. If the pile contains only 20 dimes but at least 30 of each other coin, how many collections of 30 coins can be chosen?

There are a total of 110 coins in this pileC(110,30)= 110! _

80! 30!

d. If the pile contains only 15 quarters and only 20 dimes but at least 30 of each other coin, how many collections of 30 coins can be chosen?

There are a total of 95 coins in this pileC(95,30)= 95! _

65! 30!

Page 16: Math 170 Project Part 2 By: Marlene Reyna and Guadalupe Esquivel Section 4.6#33 Section 9.3#29 Section 9.6#18

BibliographyEratosthenes Biography. (n.d). Retrieved November 16,2013, from Biography Base:

http://www.biographybase.com/biography/Eratosthenes.html