1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Stella [2.4K]
3 years ago
12

Suppose you are doing a binary search of the list [15, 18, 2, 19, 18, 0, 8, 14, 19, 14]. How many comparisons would you need to

do in order to find the key 19?
Mathematics
1 answer:
Illusion [34]3 years ago
7 0

Answer:

Three Times.

Step-by-step explanation:

First and foremost a binary search requires that the array be sorted in ascending or descending order.

After the initial step the search goes to the middle most value

i.e. [0, 2,8,14,14,15,18,18,19,19]  

will be the second 14, which is the first iteration.

Since 14 is less than 19 the search will eliminate  the lower half of the including 14, and will iterate again through the array:

[15,18,18,19,19]

The array will go to the middle most value which is 18, second iteration. Since 18 is less than 19, the program will eliminate the lower half and be left with two values i.e. [19,19].

The search will run once i.e. third iteration, and will return key value found.

You might be interested in
There is a bag filled with 3 blue and 4 red marbles.
tresset_1 [31]

Using the hypergeometric distribution, it is found that there is a 0.4286 = 42.86% probability of getting 2 of the same colour.

The marbles are chosen without replacement, hence the <em>hypergeometric </em>distribution is used to solve this question.

<h3>What is the hypergeometric distribution formula?</h3>

The formula is:

P(X = x) = h(x,N,n,k) = \frac{C_{k,x}C_{N-k,n-x}}{C_{N,n}}

C_{n,x} = \frac{n!}{x!(n-x)!}

The parameters are:

  • x is the number of successes.
  • N is the size of the population.
  • n is the size of the sample.
  • k is the total number of desired outcomes.

In this problem:

  • There is a total of 3 + 4 = 7 marbles, hence N = 7.
  • Of those, 3 are blue, hence k = 3.
  • 2 marbles will be taken, hence n = 2.

The probability of getting 2 of the same colour is the sum of P(X = 0), which is both red, with P(X = 2), which is both blue, then:

P(X = x) = h(x,N,n,k) = \frac{C_{k,x}C_{N-k,n-x}}{C_{N,n}}

P(X = 0) = h(0,7,2,3) = \frac{C_{3,0}C_{4,2}}{C_{7,2}} = 0.2857

P(X = 2) = h(2,7,2,3) = \frac{C_{3,2}C_{4,0}}{C_{7,2}} = 0.1429

Hence:

p = P(X = 0) + P(X = 2) = 0.2857 + 0.1429 = 0.4286

0.4286 = 42.86% probability of getting 2 of the same colour.

You can learn more about the hypergeometric distribution at brainly.com/question/4818951

3 0
2 years ago
The table and graph both represent
valina [46]

I'm not sure what your table and graph look like but they might both represent the relationship between numbers, like the common difference (+5 ect) They could also both represent  positive growth or negative growth depending on how the graph and table look.

Hope this helps!

8 0
3 years ago
In the diagram below, trapezoid ABCD maps to trapezoid A’B’C’D’
snow_tiger [21]

Answer:

C'

Step-by-step explanation:

Given

ABCD to A'B'C'D'

Required

Corresponding angle of C

ABCD to A'B'C'D' means that the following angles are corresponding

A \to A'

B \to B'

C \to C'

D \to D'

Hence, C' corresponds to C

6 0
2 years ago
Read 2 more answers
Find the uncertainty in a calculated average speed from the measurements of distance and time. Average speed depends on distance
zzz [600]

Answer:

\frac{\Delta v}{v}=0.426

Step-by-step explanation:

you have that the average sped is given by the following formula:

v(x,t)=\frac{x}{t}

The uncertainty formula for a division is given by:

\frac{\Delta v}{v}=\sqrt{(\frac{\Delta x}{x})^2+(\frac{\Delta t}{t})^2}        (1)

Δv: uncertainty in speed

Δx: uncertainty in the distance = 0.9m

Δt: uncertainty in time = 0.7s

x: distance = 8.1m

t: time = 1.7s

You replace the values of all parameters in the equation (1):

\frac{\Delta v}{v}=\sqrt{(\frac{0.9}{8.1})^2+(\frac{0.7}{1.7})^2}\\\\\frac{\Delta v}{v}=0.426

Hence, the relation between the uncertainty in the average velocity is 0.426

4 0
3 years ago
Rewrite the expression with a rational exponent as a radical expression.
Vilka [71]

Answer:

\sqrt{5}

Step-by-step explanation:

we know that

The "power rule" tells us that to raise a power to a power, just multiply the exponents

so

(a^{m})^{n}=a^{m*n}

we have

(5^{\frac{3}{4}})^{\frac{2}{3}}

Applying the "power rule"

(5^{\frac{3}{4}})^{\frac{2}{3}}=5^{\frac{3}{4}*\frac{2}{3}}=5^{\frac{1}{2}}=\sqrt{5}

5 0
3 years ago
Other questions:
  • Jack has 2613 songs saved on his computer. Dexter has 4 times as many song's saved on his computer as jack has. how many songs d
    15·2 answers
  • 40000 is ten times greater than
    13·2 answers
  • Show the outcomes for picking a vowel from the word APPLE and consonant from the word BOOK
    15·1 answer
  • Ray and Max are playing a game with cards. At the end of the day Max has 5 cards. If the value of each card is -50 points, how m
    13·2 answers
  • What do I select? Please answer it is very hard for me
    6·1 answer
  • Which of the following sets of values is a soulution to the following system of liner expressions, 4x+y=24 x-y=-4
    9·2 answers
  • How do you find the surface area of a pyramid
    11·1 answer
  • Question in the picture!!
    13·2 answers
  • M^2= 100, n^2 = 400, k^2=1600. What is
    11·1 answer
  • Can someone please help me and explain if you can
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!