
Patrick B. answered 07/17/19
Math and computer tutor/teacher
Not sure what you mean by lists....
Here is a list
item # of cans per box
peaches 24
pears 30
pineapple 20
applesauce 12
If you have 10 boxes of peaches, 5 boxes of pears, 7 boxes of pineapples, and 8 boxes of applesauce,
how many cans are there in total?
Answer: 10*24 + 5*30 + 7*20 + 8*12 = 240 + 150 + 140 + 96 = 626
Perhaps you meant a problem that is solved USING lists....
Flipping 3 coins, how many combinations contain exactly 2 heads?
Here's the list:
HHH
HHT
HTH
HTT
THH
THT
TTH
TTT
3 of them out of 8 contain exactly 2 heads, so the probability is 3/8 = 0.375 = 37.5%
Using sets?
Set X = { alpha, beta, delta}
How many possible subsets are there? How many contain delta?
there are 2^3 possible subsets.
empty set,
{alpha},
{beta},
{delta},
{alpha, beta}.
{alpha,delta}
{beta,delta}
{alpha,beta,delta}
4 contain delta