Statistics Week 10 graded assignment Complete Solutions Key Given In This Page Check Below . We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons If Not Able To Complete Graded Assignments
X | -1 | 4 | 5 |
---|---|---|---|
P(X=x) | 61 | 31 | 189 |
Computational Thinking week 10 graded assignment Complete Solutions Are Discussed In This Blog. We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons If Not Able To Complete Graded Assignments
1.The following pseudocode is executing using the “Scores” table. At the end of the execution, matrix represents the adjacency matrix of the graph generated from the “Scores” table.
1
D = {}
2
while(Table 1 has more rows){
3
Read the first row X in Table 1
4
D[X.SeqNo] = {"P": X.Physics, "C": X.Chemistry, "M": X.Mathematics}
5
Move X to Table 2
6
}
7
matrixPh = getAdjMatrix(D, "P")
8
matrixCh = getAdjMatrix(D, "C")
9
matrixMa = getAdjMatrix(D, "M")
10
11
Procedure getAdjMatrix(D, Subject)
12
n = length(keys(D))
13
matrix = createMatrix(n, n)
14
foreach i in rows(matrix){
15
foreach j in columns(matrix){
16
if(i != j){
17
diff = D[i][Subject] - D[j][Subject]
18
if(10 <= diff and diff <= 20){
19
matrix[i][j] = 1
20
}
21
}
22
}
23
}
24
return(matrix)
25
End getAdjMatrix
If matrixPh[i] [j] = 1, then
i scored at most 10 and at least 20 more marks in Physics than j
i scored at least 10 and at most 20 more marks in Physics than j
j scored at least 10 and at most 20 more marks in Physics than i
j scored at most 10 and at least 20 more marks in Physics than i
For all i, j with i
≠= j, matrixPh[i][j] + matrixPh[j][i] = 1
For all i, j with i
≠= j, if matrixPh[i][j] = 1 then matrixPh[j][i] = 0
For all i, j with i
≠= j, if matrixPh[i][j] = 0 then matrixPh[j][i] = 1
For all i, j with i
≠= j, if matrixPh[i][j] = 1 then matrixPh[j][i] = 1
For all i, j with i
≠= j, if matrixPh[i][j] = 0 then matrixPh[j][i] = 0
3.Consider the dictionary D, and the matrices matrixPh, matrixCh and matrixMa computed in the previous question. The following pseudocode generate the adjacency matrix matrixHelp.
1
n = length(keys(D))
2
matrixHelp = createMatrix(n, n)
3
foreach i in rows(matrixHelp){
4
foreach j in columns(matrixHelp){
5
matrixHelp[i][j] = matrixCh[i][j] + matrixPh[i][j] + matrixMa[i][j]
6
}
7
}
Let i and j be indices of two students. Choose the correct statement(s) from the given options. It is a Multiple Select Question (MSQ)
0 <= matrixHelp[i][j] <= 3
matrixHelp[i][j] + matrixHelp[j][i] <= 3
matrixHelp[i][j]
≠= matrixHelp[j][i]
if matrixHelp[i][j] = 0, then matrixHelp[j][i] = 3
if matrixHelp[i][j] = 3, then matrixHelp[j][i] = 0
4.At the end of the following pseudocode, A captures the number of distinct pairs of students who can help each other in at least one subject, and B captures the number of distinct pairs of students where one can help the other in all subjects. Choose the correct code fragment to complete the pseudocode.
1
A = 0, B = 0
2
foreach i in rows(matrixHelp){
3
foreach j in columns(matrixHelp){
4
***********************
5
*** Fill the code ***
6
***********************
7
}
8
}
9
if(matrixHelp[i][j] > 0 and matrixHelp[j][i] > 0){
A = A + 1
}
if(matrixHelp[i][j] == 3){
B = B + 1
}
if(matrixHelp[i][j] > 0 and matrixHelp[j][i] > 0){
A = A + 1
}
if(matrixHelp[i][j] > 2){
B = B + 1
}
if(i < j){
if(matrixHelp[i][j] > 0 and matrixHelp[j][i] > 0){
A = A + 1
}
if(matrixHelp[i][j] > 2){
B = B + 1
}
}
if(i < j){
if(matrixHelp[i][j] > 0 and matrixHelp[j][i] > 0){
A = A + 1
}
}
if(matrixHelp[i][j] > 2){
B = B + 1
}
Question (5-8)
The following table contains information regarding books in a library. Each entry in the table corresponds to a book and is authored by at least two authors. There is a pool of n authors, each author being assigned a unique index between 0 and n − 1. There are M books in total.
The table is represented by a dictionary named books, with the keys as serial numbers and values as the corresponding list of authors. Assume that books has already been computed. For example, we have: books[0] = [0, 2, 3]. Consider the followig question.
4.The following pseudocode generates a graph G from books. Each node corresponds to an author. There is an edge between two different authors i and j if they have co-authored a book, and the edge is labeled with the number of books they have co-authored. Choose the correct code fragment to complete the following pseudocode.
1
matrix = createMatrix(n, n)
2
foreach i in keys(books){
3
foreach j in books[i]{
4
foreach k in books[i]{
5
***********************
6
*** Fill the code ***
7
***********************
8
}
9
}
10
}
matrix[j][k] = matrix[j][k] + 1
if(j != k){
matrix[j][k] = matrix[j][k] + 1
}
if(j != k){
matrix[j][k] = matrix[j][k] + 1
matrix[k][j] = matrix[k][j] + 1
}
matrix[j][k] = matrix[j][k] + 1
matrix[k][j] = matrix[k][j] + 1
5.The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors i and j, what does the value matrix2[i][j] represent at the end of the execution?
1
matrix2 = createMatrix(n, n)
2
foreach j in rows(matrix2){
3
foreach k in columns(matrix2){
4
matrix2[j][k] = []
5
}
6
}
7
foreach i in keys(books){
8
foreach j in book[i]{
9
foreach k in books[i]{
10
foreach h in books[i]{
11
if(j != k and j != h and k != h and not member(matrix2[j][k], h)){
12
matrix2[j][k] = matrix2[j][k] ++ [h]
13
matrix2[k][j] = matrix2[k][j] ++ [h]
14
}
15
}
16
}
17
}
18
}
List of authors who have co-authored a book with both i and j
List of authors who have co-authored a book with either i or j
List of authors who have co-authored at least two book with both i and j
List of authors who have co-authored at least two book with either i or j
6.Which of the following combinations of entries in matrix and matrix2 is possible for two different authors i and j? It is Multiple Select Question (MSQ).
matrix[i] [j] = 0 and matrix2[i] [j] = [ ]
matrix[i][j] = 0 and matrix2[i][j]
≠= [ ]
matrix[i][j] > 0 and matrix2[i][j] = [ ]
matrix[i][j] > 0 and matrix2[i][j]
≠= [ ]
Consider the matrices matrix and matrix2 constructed in the previous questions.
findAuthor(matrix) finds an author who has the maximum number of co-authors. Choose the correct implementation of the procedure findAuthor. It is a Multiple Select Question.
Procedure findAuthor(M)
Max = 0
A = 0
foreach i in rows(M){
Sum = 0
foreach j in columns(M){
if(M[i][j] > 0){
Sum = Sum + 1
}
}
if(Sum > Max){
Max = Sum
A = i
}
}
return(A)
End findAuthor
Procedure findAuthor(M)
Max = 0
A = 0
foreach i in rows(M){
Sum = 0
foreach j in columns(M){
if(M[i][j] > 0){
Sum = Sum + M[i][j]
}
}
if(Sum > Max){
Max = Sum
A = i
}
}
return(A)
End findAuthor
Procedure findAuthor(M)
Max = 0
A = 0
foreach i in columns(M){
Sum = 0
foreach j in rows(M){
if(M[j][i] > 0){
Sum = Sum + 1
}
}
if(Sum > Max){
Max = Sum
A = i
}
}
return(A)
End findAuthor
Procedure findAuthor(M)
Max = 0
A = 0
foreach i in columns(M){
Sum = 0
foreach j in rows(M){
if(M[j][i] > 0){
Sum = Sum + M[j][i]
}
}
if(Sum > Max){
Max = Sum
A = i
}
}
return(A)
End findAuthor
Question (9-10)
The following pseudocode is executing using the “Shopping bills” dataset. Each customer is being assigned a unique index between 0 and n − 1. Dictionary D has already been computed with keys as index and values as list of distinct shops visited by the corresponding customer. Assume that there exists a procedure intersection which takes two lists as input and outputs another list which contains the common elements in the input lists.
1
n = length(keys(D))
2
matrix = createMatrix(n, n)
3
foreach i in rows(matrix){
4
foreach j in columns(matrix){
5
if(i != j){
6
matrix[i][j] = intersection(D[i], D[j])
7
}
8
else{
9
matrix[i][j] = []
10
}
11
}
12
}
Consider the adjacency matrix matrix constructed above. Assume that there exists a procedure removeDuplicate which receives a list as input and removes all duplicate elements in the list. When will findGoodSet(matrix) return True?
1
Procedure findGoodSet(M)
2
foreach i in rows(M){
3
foreach j in columns(M){
4
foreach h in rows(M){
5
list1 = []
6
if(length(M[i][j]) == 1 and member(D[h], first(M[i][j]))){
7
list1 = list1 ++ M[i][j]
8
}
9
if(length(M[i][h]) == 1 and member(D[j], first(M[i][h]))){
10
list1 = list1 ++ M[i][h]
11
}
12
if(length(M[j][h]) == 1 and member(D[i], first(M[j][h]))){
13
list1 = list1 ++ M[j][h]
14
}
15
list1 = removeDuplicate(list1)
16
if(length(list1) == 1){
17
return(True)
18
}
19
}
20
}
21
}
22
return(False)
23
End findGoodSet
If there exists three customers who have visited all three shops.
If there exist three customers such that every pair of customers among them have visited only one and the same shop in common.
If there exists three customers who have visited exactly one shop.
If there exists three customers where each pair among them have visited exactly one shop in common.
10.For a pair of customers i and j, j is said to be shopping partner of i if i and j have visited at least two shops in common. findTopCustomer(matrix) finds a customer who has the maximum shopping partners. Choose the correct implementation of findTopCustomer.
Procedure findTopCustomer(M)
Max = 0, A = 0
foreach i in rows(M){
C = 0
foreach j in columns(M) {
if(length(M[i][j]) == 2){
C = C + 1
}
}
if(C > Max){
Max = C
A = i
}
}
return(A)
End findTopCustomer
Procedure findTopCustomer(M)
Max = 0, A = 0
foreach i in rows(M){
C = 0
foreach j in columns(M){
if(length(M[i][j]) > 1){
C = C + 1
}
}
if(C > Max){
Max = C
A = i
}
}
return(A)
End findTopCustomer
Procedure findTopCustomer(M)
Max = 0, A = 0
foreach i in rows(M){
C = 0
foreach j in columns(M) {
if(length(M[i][j]) == 2){
C = C + 1
}
}
if(C > Max){
Max = C
A = i
}
}
return(Max)
End findTopCustomer
Procedure findTopCustomer(M)
Max = 0, A = 0
foreach i in rows(M){
C = 0
foreach j in columns(M){
if(length(M[i][j]) > 1){
C = C + 1
}
}
if(C > Max){
Max = C
A = i
}
}
return(Max)
End findTopCustomer
English Week 10 graded assignment Complete Solutions PDF Are Given Here . We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons If Not Able To Complete Graded Assignments
1.The maximum number of non-zero entries in an adjacency matrix of a simple graph having �n vertices can be
2.We have a graph �G with 6 vertices. We write down the degrees of all vertices in �G in descending order. Which of the following is a possible listing of the degrees?
4.Suppose we obtain the following BFS tree rooted at node 1 for an undirected graph with vertices (1,2,3,4,5,…..14).(1,2,3,4,5,…..14).
Which of the following cannot be an edge in the original graph?
2 MUTIPLE SELECT QUESTIONS:
Which of the following graphs satisfies the below properties:
1. ∣��(�)∣∣VC(G)∣ = 33, where ��(�)VC(G) is the minimum vertex cover of a graph �.G.
2. ∣��(�)∣∣PM(G)∣ = 33, where ��(�)PM(G) is the perfect matching of a graph �.G.
3. The graph is a 3-colouring.
3 NUMERICAL ANSWER TYPE:
If A = [0101000101101001000001100111000100001010000001000]⎣⎡0101000101101001000001100111000100001010000001000⎦⎤ represents adjacency matrix of a graph �,G, then the cardinality of the maximum independent set of the graph �G is
A company manufactures 1010 chemicals �1,�2,�3,….�10.x1,x2,x3,….x10. Certain pairs of these chemicals are incompatible and would cause explosions if brought into contact with each other. Below graph shows the incompatibility of the chemicals, each vertex represents the chemical and each edge between a pair of chemicals represents that those two chemicals are incompatible. As a precautionary measure the company wishes to partition its warehouse into compartments, and store incompatible chemicals in different compartments. What is the least number of compartments into which the warehouse should be partitioned?
10. An incomplete undirected graph is given below and the numbering on each vertex denotes the colouring of the graph(‘11‘ denotes color 1, ‘22’ denotes color 22, and ‘33’ denotes color 33). Find the number of maximum edges that can be added to the given graph such that the colouring is retained and the graph is planar.
NOTE: Planar graph is a graph that can be drawn on the plane in such a way that its edges intersect only at their endpoints.
English week 9 graded assignment Complete Solutions Are Discussed In This Blog We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons Not Able To Complete Graded Assignments
Statistics week 9 graded assignment Complete Solutions Are Discussed In This Blog We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons Not Able To Complete Graded Assignments Check Below For Master Key
1.A discrete random variable �X can take the values 1,2,···,7. For these values the cumulative distribution function is defined by:�(�)=�(�≤�)=�2+�95F(x)=P(X≤x)=95x2+k; �x= 1,2,···,7. Find the value of �k.
2.An organization in Texas organizes lucky draw this month. 3 thousand tickets are sold for 2$ each. Each has an equal chance of winning. 1 tickets will win 698$, 3 tickets will win 353$ and 4 tickets will win 63$. Let, the random variable �X denote the net gain from purchase of one ticket. What is the probability that �X takes the value less than 353? (Enter the answer correct to 4 decimal place)
3. In a group of 204 people, 29 are photographers and 175 are journalists. 12 people are randomly picked from a group of these 204 people. Let, �Y be a random variable which represents the number of photographers. How many possible values can the random variable �Y take?
5.A biased coin with probability of heads 0.750.75 is tossed three times. Let �X be a random variable that represents the number of head runs, a head run being defined as a consecutive occurrence of at least two heads. Then the probability mass function of �X is given by:
6. Nina has 6 music sessions in a week. She attends the sessions 6 days a week 59% of the time, 5 days 13% of the time, one day 7% of the time, and no days 21% of the time. Let, �X be a discrete random variable representing the number of sessions she attends in a week. Suppose one week is randomly selected, what is the probability that the random variable �X take the value at most 5?(Enter the answer correct to 2 decimal places)
7.Find the value of k for which k(47)�(74)x( x = 0, 1, 2, …) is a pmf.(Enter the answer correct up to 2 decimal places)
8.Using the information in previous question, calculate �(�=2)P(X=2).(Enter the answer correct up to 2 decimal places)
9.From a box �A containing 3 white and 6 black balls, 5 balls are transferred into an empty box �B. Let �X be a random variable that represents the number of white balls which are transferred from �A to �B. What value of random variable will have the least probability?
10. The probability mass function of a random variable X is given by:
�(�=�)P(X=x)= {3�2−3�for �=02�2−1for�=10otherwise⎩⎨⎧3k2−3k2k2−10for x=0forx=1otherwise
Determine the value of k given �>0k>0.
Computational Thinking week 9 graded assignment Complete Questions Are Discussed In This Blog. Access From Below Link
Consider a graph generated from the “Scores” table that is represented by a matrix B. Each node in the graph corresponds to a student from the table. SeqNo is used to label the nodes in the graph. Study the given pseudocode and answer the following questions.
1
A = {}
2
while(Table 1 has more rows){
3
Read the first row X in Table 1
4
A[X.SeqNo] = [X.CityTown, X.Gender]
5
Move X to Table 2
6
}
7
n = length(keys(A))
8
B = createMatrix(n, n)
9
foreach i in keys(A){
10
foreach j in keys(A){
11
if(i != j and isRelated(A[i], A[j])){
12
B[i][j] = 1
13
}
14
}
15
}
16
Procedure isRelated(x, y)
17
if(first(x) == first(y) and last(x) == last(y)){
18
return(True)
19
}
20
else{
21
return(False)
22
}
23
End isRelated
1.There is an edge between students i and j, with i ≠= j, if and only if:
they are from the same city/town
they have the same gender
they are from the same city/town and have the same gender
they are from the same city/town or have the same gender
2. Which of the following statements are true about this graph? It is a Multiple Select Question (MSQ).
There are two cliques in this graph, one for each gender
In every clique, there is at least a pair of students having different genders
All students in a given clique have the same gender
All students in a given clique are from the same city/town
There are no cliques in this graph
3. The following table contains information regarding books in a library. Each row in the table corresponds to a book and is authored by exactly two authors, with equal contributions from both. There is a pool of n authors, each author being assigned a unique index between 0 and �−1n−1. There are M books in total.
The table is represented by a dictionary named books, with the keys as serial numbers and values as the corresponding list of authors. Assume that books has already been computed. For example, we have:
books[0] = [4, 0]
A graph G is generated from this table. Each node corresponds to an author. There is an edge between authors i and j if and only if they have collaborated on a book. Given a pair of authors (i, j), with i ≠= j, what does the value colab[i] [j] represent at the end of the execution of the following pseudocode? Assume that the number of authors, n, is given to you.
1
colab = createMatrix(n, n)
2
auth1 = 0, auth2 = 0
3
4
foreach i in keys(books){
5
6
auth1 = first(books[i])
7
8
auth2 = last(books[i])
9
10
colab[auth1][auth2] = colab[auth1][auth2] + 1
11
12
colab[auth2][auth1] = colab[auth2][auth1] + 1
13
14
}
It represents the number of books published by authors i or j
It represents the number of books in which authors i and j have collaborated
It represents the number of books published by author i + number of books published by author j
It represents the number of books published by author i in which he has not collaborated with author j
Question-(4 to 11)
Using the matrix colab computed from the previous problem, answer the following questions. For each question, what do the variables aVar and bVar represent at the end of execution of the pseudocode? Pick the correct option from the table given below.
aVar = 0
bVar = []
foreach r in rows(colab){
foreach c in columns(colab){
if (colab[r][c] > aVar){
aVar = colab[r][c]
bVar = [r, c]
}
}
}
4. What is the correct option for variable aVar?
5.What is the correct option for variable bVar?
aVar = 0
bVar = 0
foreach r in rows(colab){
count = 0
foreach c in columns(colab){
if (colab[r][c] > 0){
count = count + 1
}
}
if(count > aVar){
aVar = count
bVar = r
}
}
6.What is the correct option for variable aVar?
7.What is the correct option for variable bVar?
aVar = 0
bVar = 0
foreach r in rows(colab){
count = 0
foreach c in columns(colab){
count = count + colab[r][c]
}
if(count > aVar){
aVar = count
bVar = r
}
}
8.What is the correct option for variable aVar?
9. What is the correct option for variable bVar?
1
aVar = 0
2
bVar = []
3
foreach r in rows(colab){
4
count = 0
5
foreach c in columns(colab){
6
if (colab[r][c] > 0){
7
count = count + 1
8
}
9
}
10
if(count == 1){
11
aVar = aVar + 1
12
bVar = bVar ++ [r]
13
}
14
}
15
10.What is the correct option for variable aVar?
7
11.What is the correct option for variable bVar?
Continuing with the previous question, authors is a list of authors. isClique is a procedure that determines if every pair of authors in this list have collaborated at least once. It returns False if at least one pair of authors haven’t collaborated, and True if every pair of authors have collaborated at least once. Select the correct code fragment to complete the pseudocode. It is a Multiple Select Question (MSQ).
1
Procedure isClique(authors, colab)
2
foreach i in authors{
3
foreach j in authors{
4
*********************
5
* Fill the code *
6
*********************
7
}
8
}
9
return(True)
10
End isClique
if(i != j and colab[i][j] > 0){
return(False)
}
if (i != j and colab[i][j] == 0){
return(False)
}
if(i != j){
if(colab[i][j] == 1){
return (False)
}
}
if(i != j){
if(colab[i][j] == 0){
return(False)
}
}
if(i != j){
if(colab[i][j] == 0){
return(True)
}
}
A computer scientist is planning to conduct an event in the city. She has come up with a novel scheme to invite people:
The host (computer scientist) can send out any number of invitations and does not accept any invitation.
This situation is modeled as a graph. There is a node corresponding to every person who attends the event. n people attend the event and the attendees are indexed from 0 to �−1n−1. Given a pair of attendees (i, j), there is an edge from i to j if and only if the following conditions are satisfied:
The graph is represented by a matrix A, such that A[i] [j] = 1 if and only if there is an edge from i to j.
For the case of n = 5, which of the following is a possible representation of the graph?
Continuing with the previous question, for a pair of attendees (i, j) other than the host, we say that i is the ancestor of j, if their messages are identical and i has accepted the invitation before j. Note that each invitation sent out by the host is a unique text message. Assume that the matrix A that represents the graph has already been computed.
isAncestor is a procedure that accepts the matrix A and two attendees i and j other than the host as input, with i ≠= j, and returns True if i is the ancestor of j, and False otherwise. Select the correct code fragment to complete the pseudocode.
1
Procedure isAncestor(A, i, j)
2
k = i
3
flag = True
4
while(flag){
5
flag = False
6
foreach c in columns(A){
7
*********************
8
* Fill the code *
9
*********************
10
}
11
}
12
return(False)
13
End isAncestor
if(A[k][c] == 1){
if(c == j){
return(True)
}
k = c
exitloop
}
if(A[k][c] == 1){
if(c == j){
return (True)
}
flag = True
exitloop
}
if(A[k][c] == 1){
if(c == j){
flag = True
return(True)
}
k = c
exitloop
}
if(A[k][c] == 1){
if(c == j){
return(True)
}
k = c
flag = True
exitloop
}
Maths Week 9 Graded Assignments Questions Are Different So Do From Master Key Access Below Any Doubt Feel Free To Comment And Ask Some Questions Are Same