3
$\begingroup$

"A sample space is the set of all possible outcomes of a random process or experiment. An event is a subset of a sample space" enter image description here For any finite set A, N(A) denotes the number of elements in A. enter image description here enter image description here

Suppose $A[1], A[2], A[3], . . . , A[n]$ is a one-dimensional array and $n ≥ 50$.

a. How many elements are in the array?
b. How many elements are in the subarray
$A[4], A[5], . . . , A[39]$?
c. If $3 ≤ m ≤ n$, what is the probability that a randomly chosen array element is in the subarray $A[3], A[4], . . . , A[m]$?
d. What is the probability that a randomly chosen array element is in the subarray shown below if n = 39?
$A[\lfloor \frac n2 \rfloor], A[\lfloor \frac n2 \rfloor + 1], . . . , A[n]$

Source: Discrete Mathematics with Applications Susanna S. Epp I'm not sure about my answer for d. Can you show how to solve the question d?

My answer
a. $n$
b. $36 $
c. $\frac {m-2}n$
d(edited).

$A[\lfloor \frac {39}{2} \rfloor]=A[19], A[\lfloor \frac {39}{2} \rfloor + 1]=A[20], . . . , A[39]$ has 39-18=21 elements

So $\frac {21}{39}$

$\endgroup$

1 Answer 1

1
$\begingroup$

I too think you might have made a mistake. Firstly, there is no $m$ or infact, no variable in the question.. unless the question was -

What is the probability that a randomly chosen array element is in the subarray shown below if $m = 39$? $A[\lfloor \frac m2], A[⌊\frac m2⌋ + 1], . . . , A[m]$

If so, then the answer would be-
$⌊\frac m2⌋= 19$ and so, there are $21$ elements.

The probability would then be $\frac {21}n$

If the original question is right though, then the answer would be -

$\frac {21}{39}$ putting $n=39$ above.

$\endgroup$
2
  • $\begingroup$ There are 39-18=21 elements in an array A[39], ..., A[$\lfloor \frac {m}{2} \rfloor$ + 1 = 20] A[$\lfloor \frac {m}{2} \rfloor$ = 19] $\endgroup$
    – buzzee
    Mar 7, 2016 at 8:34
  • $\begingroup$ @buzzee Thank you. Edited. Anyway, you already got it. $\endgroup$ Mar 7, 2016 at 12:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .