the students answered a survey and the following information was obtained.
•70% of students regularly attended the classes.
•85% of students who attended the classes passed
.•40% of students who didn’t attend the classes failed.
Alice, a random students from that class, has passed this course. What is the probability that she has attended the classes?
In: Statistics and Probability
I have a statistics class of 20 students, of whom 12 are female. I randomly select three students to make a group presentation to the class. What is the probability of the following occurring?
a. All of the students in the group are male.
b. One of the students in the group is male.
c. Two of the students in the group are male.
d. All three of the students in the group are female.
e. Calculate the mean and standard deviation for the distribution which defines selecting a male as a success.
In: Statistics and Probability
BinarySearch(A, p, r, V)
if p < r
q = (p + r)/2
if V = A[q]
return q
else if V > A[q]
return BinarySearch(A, q+1, r, V)
else return BinarySearch(A, p, q-1)
else if p = r,
if V = A[p]
return p
else
return -1
return -1
end function
Using this pseudocode, write a function for BinarySearch and also complete the program, by writing a main, which will supply the array A (you may like to use the same main as the other programming exercise you have done so far), and also get an user input for V (which should have same data type as the array itself).
Call the function BinarySearch by sending the array, and 1 for p, N for r and V, store the value in a variable x, which stores the position number of the searched key V.
Then check if x is -1, then display data is not found, otherwise display the value of x, by using a suitable title, saying Data V is found in location x (value of x should be displayed).
Must compile, run and copy and paste the program underneath this word document.
2. a) Construct a Binary Search Tree using the following data:
54 37 17 28 44 71 64 60
b) Illustrate how will you search for 30 from the above tree and how many searches will be needed.
c) Illustrate how you will delete the root from the above tree, redraw the tree after deletion.
d) Add a new data after conducting operation c, say the new value = 50
(Do not start from scratch, show this operation by adding onto existing Tree).
e) Write down the pre-order, post-order and in-order traversal.
In: Computer Science
public class Graph
{
private ST<String, SET<String>> st;
public Graph()
{ st = new ST<String, SET<String>>(); }
public void addEdge(String v, String w)
{ // Put v in w's SET and w in v's SET.
if (!st.contains(v)) st.put(v, new SET<String>());
if (!st.contains(w)) st.put(w, new SET<String>());
st.get(v).add(w);
st.get(w).add(v);
}
public Iterable<String> adjacentTo(String v)
{ return st.get(v); }
public Iterable<String> vertices()
{ return st.keys(); }
// See Exercises 4.5.1-4 for V(), E(), degree(),
// hasVertex(), and hasEdge().
public static void main(String[] args)
{ // Read edges from standard input; print resulting graph.
Graph G = new Graph();
while (!StdIn.isEmpty())
G.addEdge(StdIn.readString(), StdIn.readString());
StdOut.print(G);
}
}
Note: The induced subgraph is the graph comprised of the specified vertices together with all edges from the original graph that connect any two of them.
>more graph.txt
A B
A C
C G
A G
H A
B C
B H
>java SubGraph graph.txt A C G
The graph is
A: B C G H
B: A C H
C: A B G
G: A C
H: A B
The subgraph is
A: C G
C: A G
G: A C
In: Computer Science
Question Two
Faulu College has a total of 52 students undertaking three courses namely; Business Mathematics, Economics and Law. During recently conducted examinations, 13 students excelled in Business Mathematics and Law, 16 students excelled in Business Mathematics and Economics and 12 students excelled in Law and Economics. The number of students that excelled in Economics was 24 while 2 students excelled in none of the three courses. The number of students who excelled in Business Mathematics only was twice the number of students who excelled in Law only. The number of students who excelled in Law only was six times the number of students who excelled in Economics only.
Required:
Question three
Parents of a young girl want to deposit a sum of money which will earn interest at the rate of 9% per year compounded semiannually. The deposit will be used to generate a series of eight semiannual payment of Sh. 2500 beginning 6 months after the deposit. These payments will be used to help finance their daughter’s high school education.
Required:
In: Advanced Math
An article compared the drug use of 288 randomly selected high school seniors exposed to a drug education program (DARE) and 335 randomly selected high school seniors who were not exposed to such a program. Data for marijuana use are given in the accompanying table.
| n |
Number Who Use Marijuana |
|
|---|---|---|
| Exposed to DARE | 288 | 142 |
| Not Exposed to DARE | 335 | 177 |
Is there evidence that the proportion using marijuana is lower for students exposed to the DARE program? Use α = 0.05.(Use pDARE − pNo DARE. Round your test statistic to two decimal places and your P-value to four decimal places.)
z=
P-value=
State your conclusion.
We reject H0. We do not have convincing evidence that the proportion of students using marijuana is lower for students exposed to the DARE program than for students not exposed to the program.
We fail to reject H0. We have convincing evidence that the proportion of students using marijuana is lower for students exposed to the DARE program than for students not exposed to the program.
We reject H0. We have convincing evidence that the proportion of students using marijuana is lower for students exposed to the DARE program than for students not exposed to the program.
We fail to reject H0. We do not have convincing evidence that the proportion of students using marijuana is lower for students exposed to the DARE program than for students not exposed to the program.
In: Math
Derive a finite-difference method for solving the non-linear parabolic equation using the Explicit Method
Ut=v*Uxx-U*Ux
Where v is the viscosity
In: Mechanical Engineering
Let U be a subset of a vector space V. Show that spanU is the intersection of all the subspaces of V that contain U. What does this say if U=∅? Need proof
In: Advanced Math
Derive a finite-difference method for solving the non-linear parabolic equation using the Explicit Method
Ut=v*Uxx-U*Ux
Where v is the viscosity
In: Physics
How many total atoms are contained in 75 g of arsenic (V) arsenate? How many total ions are contained in 75 g of arsenic (V) arsenate?
In: Chemistry