   Chapter 9.1, Problem 24ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# Suppose A [ 1 ] , A [ 2 ] , ... , A [ n ] is a one-dimensional array n ≥ 2 . Consider the subarray   A [ 1 ] , A [ 2 ] , ... A [ ⌊ n / 2 ⌋ ] . How many elements are in the subarray (i) if n is even? And (ii) if n is odd? What is the probability that a randomly chosen array element is in the subarray (i) n is even? and (ii) if n is odd?

To determine

(a)

The number of elements in the given subarray.

Explanation

Given information:

Aone-dimensional array is given as, A,A,......,A[n] where n2.

And a subarray is given as,

Calculation:

In the given subarray

If n is even, then number of elements in the subarray would be which is equal to n2

To determine

(b)

The probability that a randomly chosen element is in the subarray.

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 