Question: MATH 1111 : Chapter 9 : Lab 9.2 Some definitions for the lab. A = [ 5, 7, 2, 9, 1, 3, 4, 3, 5,

MATH 1111 : Chapter 9 : Lab 9.2

Some definitions for the lab.

A = [ 5, 7, 2, 9, 1, 3, 4, 3, 5, 8, 7, 3 ]

B = [ 5, 8, 3, 5, 9, 5, 4, 7, 1, 0, 5, 7, 8 ]

C = [ "W", "X", "Y", "A", "B", "M", "N", "P" ]

D = [ "A", "B", "C", "X", "Y", "Z", "G", "M", "T", "W" ]

E = 3

F = "ABCDEFGH"

G = "F"

H = 5

T = [ [ 4, 5, 6 ], [ 4, 3 ], [ 1, 2, 3 ], [ 4, 5, 6, 7, 8 ], [ 7, 8, 9 ] ]

W = "ABCJKLMNTVWXYZ"

X = "PQRSTUVW"

Y = [ [ "A", "B", "C" ], [ "T", "R" ], [ "D", "E", "F" ], [ "W", "X", "Y", "Z" ], [ "G", "H" ] ]

Z = 23.658

Coin = [ "H", "T" ]

Die = [ 1, 2, 3, 4, 5, 6 ]

Starter = [ ]

Blank = ""

alph = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

Each expression evaluation begins from these definitions. Any alterations during the evaluation of the

expression is lost after the conclusion of the evaluation of that expression, although the alteration does

hold in effect until the end of that evaluation.

Random Number Function

1) 0.00798219 2) 0.95777 3) 0.569994

4) 0.0858953 5) 0.788639 6) 0.11372

7) 0.572406 8) 0.453769 9) 0.955987

10) 0.96172 11) 0.561944 12) 0.736736

13) 0.0398207 14) 0.917949 15) 0.652045

16) 0.686816 17) 0.101823 18) 0.0118972

19) 0.967129 20) 0.48664 21) 0.469347

22) 0.636154 23) 0.92579 24) 0.810946

25) 0.316752 26) 0.601198 27) 0.0508473

28) 0.682362 29) 0.419461 30) 0.592436

31) 0.721678 32) 0.764962 33) 0.704385

34) 0.439848 35) 0.485942 36) 0.325005

37) 0.286768 38) 0.314429 39) 0.736418

40) 0.922427 41) 0.497034 42) 0.0954018

43) 0.407317 44) 0.357644 45) 0.346741

46) 0.178065 47) 0.307877 48) 0.0171275

49) 0.820913 50) 0.493516 51) 0.242902

52) 0.72014 53) 0.776894 54) 0.318508

55) 0.921714 56) 0.43593 57) 0.910811

58) 0.485533 59) 0.822344 60) 0.194783

MATH 1111 : Chapter 9 : Lab 9.2 Name_________________________

Evaluate/Calculate Value

1 Coin[floor(random() * length(Coin))]

2 Coin[floor(random() * length(Coin))]

3 Coin[floor(random() * length(Coin))]

4 Die[floor(random() * length(Die))]

5 Die[floor(random() * length(Die))]

6 Die[floor(random() * length(Die))]

7 charAt(F, floor(random() * length(F)))

8 charAt(F, floor(random() * length(F)))

9 charAt(F, floor(random() * length(F)))

1

0 T[floor(random() * 5)][floor(random() * 2)]

1

1 Y[floor(random() * length(Y))]

1

2 length(Y[floor(random() * length(Y))])

1

3 floor(Z * random())

1

4 floor(Z * random()) % 2

1

5 A[floor(random() * length(A))] - B[floor(random() * length(B))]

1

6 A[B[floor(random() * length(B))]]

1

7 alph[floor(random() * length(alph))]

1

8 A[floor(E * random())]

1

9 [ floor(E * random()), floor(H * random()), floor(E * random()) ]

2

0 random() < 0.5

2

1 random() < 0.5

2

2 random() < 0.5

2

3 A[floor(H * random())] <= 5

2

4 (random() < 0.5) && (random() < 0.5)

2

5 (random() < 0.5) || (random() < 0.5)

26) A bag of marbles contains 10 marbles. They are all white marbles with black numbers written on

them. The numbers are 3, 2, 3, 5, 1, 6, 3, 2, 4, 1. You reach into the bag with one hand and grab two

marbles. List all of the possible pairs of numbers of the two marbles in your hand.

27) You are creating an array of two numbers. A bag of marbles contains 5 marbles. They are all white

marbles with black numbers written on them. The numbers are 3, 2, 3, 5, 1. You reach into the bag and

grab one marble. You record the number in the 0 th position of the array. Set this marble to the side.

Now you reach in a second time and grab one marble. You record the number in the 1 st position of the

array. List all of the possible arrays that could be made.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!