The tournament sort is a sorting algorithm that works by building an ordered binary tree. We represent the elements to be sorted by vertices that sill become the leaves. We build up the tree one level at a time we would construct the tree representing the winners of matches in a tournament Working left to right, we compare pairs of consecutive elements, adding a parent vertex labeled with the larger of the two elements under comparison. We make similar comparisons between labels of vertices at each level until we reach the root of the tree that is labeled with the largest element. The tree constructed by the tournament sort of , 8.14,17,3,9,27,11 is ilinstrated in part(a)ef the figure. Once the argestelementhbeendetermined. The leaf with this labelisrelabeled by -s,which is definedtobelessthanevery element The labels of all vertices on the path from this vertex up to the root of the tree are recalculated, as shown in part (b) of the figure.
This produces the second largest element This process continues until the entire list has been sorted.
26.
a) Use Huan coding to encode these symbols with frequencies a: 04, b: 0.2, C: 0.2, d 0.1, e: 0.1 in two different ways by breaking ties inthe aorithmdifferenUy, First. among the trees of minimum weight select two trees with the largest ntunberof vertices to
combineateachstageoftheaorithni Second, amongthe trees of mmimmweightselectreeswiththesmaflestnumberof
vertices at each stage.
b) Compute the average number of bits required to encode a symbol with each code and compute the variances of this number of bits for each code. Which tie-breaking procedure produced the smaller variance in the number of bits required to encode a symbol?
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Discrete Mathematics and Its Applications ( 8th International Edition ) ISBN:9781260091991
- Please help me with this in matrix pleasearrow_forwardPlease solve the differential geometry problem No chatgpt pls will upvote.arrow_forwardQ1. A group of five applicants for a pair of identical jobs consists of three men and two women. The employer is to select two of the five applicants for the jobs. Let S denote the set of all possible outcomes for the employer's selection. Let A denote the subset of outcomes corresponding to the selection of two men and B the subset corresponding to the selection of at least one woman. List the outcomes in A, B, AUB, AN B, and An B. (Denote the different men and women by M₁, M2, M3 and W₁, W2, respectively.)arrow_forward
- For the following function, find the full power series centered at a of convergence. 0 and then give the first 5 nonzero terms of the power series and the open interval = f(2) Σ 8 1(x)--(-1)*(3)* n=0 ₤(x) = + + + ++... The open interval of convergence is: 1 1 3 f(x)= = 28 3x6 +1 (Give your answer in help (intervals) .)arrow_forwardQ3 (8 points) Q3. A survey classified a large number of adults according to whether they were diag- nosed as needing eyeglasses to correct their reading vision and whether they use eyeglasses when reading. The proportions falling into the four resulting categories are given in the following table: Use Eyeglasses for Reading Needs glasses Yes No Yes 0.44 0.14 No 0.02 0.40 If a single adult is selected from the large group, find the probabilities of the events defined below. The adult (a) needs glasses. (b) needs glasses but does not use them. (c) uses glasses whether the glasses are needed or not.arrow_forward4. (i) Let a discrete sample space be given by N = {W1, W2, W3, W4}, and let a probability measure P on be given by P(w1) = 0.2, P(w2) = 0.2, P(w3) = 0.5, P(wa) = 0.1. Consider the random variables X1, X2 → R defined by X₁(w1) = 1, X₁(w2) = 2, X2(w1) = 2, X2 (w2) = 2, Find the joint distribution of X1, X2. (ii) X1(W3) = 1, X₁(w4) = 1, X2(W3) = 1, X2(w4) = 2. [4 Marks] Let Y, Z be random variables on a probability space (, F, P). Let the random vector (Y, Z) take on values in the set [0, 1] x [0,2] and let the joint distribution of Y, Z on [0, 1] x [0,2] be given by 1 dPy,z (y, z) ==(y²z+yz2) dy dz. harks 12 Find the distribution Py of the random variable Y. [8 Marks]arrow_forward
- Need help answering wuestionarrow_forwardFor the following function, find the full power series centered at x = 0 and then give the first 5 nonzero terms of the power series and the open interval of convergence. f(x) = Σ| n=0 9 f(x) = 6 + 4x f(x)− + + + ++··· The open interval of convergence is: ☐ (Give your answer in help (intervals) .)arrow_forwardmarks 11 3 3/4 x 1/4 1. There are 4 balls in an urn, of which 3 balls are white and 1 ball is black. You do the following: draw a ball from the urn at random, note its colour, do not return the ball to the urn; draw a second ball, note its colour, return the ball to the urn; finally draw a third ball and note its colour. (i) Describe the corresponding discrete probability space (Q, F, P). [9 Marks] (ii) Consider the following event, A: Among the first and the third balls, one ball is white, the other is black. Write down A as a subset of the sample space and find its probability, P(A). [2 Marks]arrow_forward
- There are 4 balls in an urn, of which 3 balls are white and 1 ball isblack. You do the following:• draw a ball from the urn at random, note its colour, do not return theball to the urn;• draw a second ball, note its colour, return the ball to the urn;• finally draw a third ball and note its colour.(i) Describe the corresponding discrete probability space(Ω, F, P). [9 Marks](ii) Consider the following event,A: Among the first and the third balls, one ball is white, the other is black.Write down A as a subset of the sample space Ω and find its probability, P(A)arrow_forwardLet (Ω, F, P) be a probability space and let X : Ω → R be a randomvariable whose probability density function is given by f(x) = 12 |x|e−|x| forx ∈ R.(i) Find the characteristic function of the random variable X.[8 Marks](ii) Using the result of (i), calculate the first two moments of therandom variable X, i.e., E(Xn) for n = 1, 2. [6 Marks]Total marks 16 (iii) What is the variance of X?arrow_forwardLet X be a random variable with the standard normal distribution, i.e.,X has the probability density functionfX(x) = 1/√2π e^-(x^2/2)2 .Consider the random variablesXn = 20(3 + X6) ^1/2n e ^x^2/n+19 , x ∈ R, n ∈ N.Using the dominated convergence theorem, prove that the limit exists and find it limn→∞E(Xn)arrow_forward
- Discrete Mathematics and Its Applications ( 8th I...MathISBN:9781259676512Author:Kenneth H RosenPublisher:McGraw-Hill EducationMathematics for Elementary Teachers with Activiti...MathISBN:9780134392790Author:Beckmann, SybillaPublisher:PEARSON
- Thinking Mathematically (7th Edition)MathISBN:9780134683713Author:Robert F. BlitzerPublisher:PEARSONDiscrete Mathematics With ApplicationsMathISBN:9781337694193Author:EPP, Susanna S.Publisher:Cengage Learning,Pathways To Math Literacy (looseleaf)MathISBN:9781259985607Author:David Sobecki Professor, Brian A. MercerPublisher:McGraw-Hill Education