a) Design an adjacency Matrix of the alphabets of your full name(USAMA ZAFAR). In accordance with the following conditions: • If your name has repeated characters (s.g, character E, 2 times) then you will consider only 1 time. • If your Name contains both G and S, then there will be an edge between them and one additional edge from W to each if W is also in your name. • If N is the alphabet in your name, it will have an edge to A and S if it available in your name. • If P is available then it will have an edge with L if it is available. • If there is a blank space in full Name then it will be represented by “_", and it must have an edge with all alphabets. (Note: Place on in 1 for Edge and 0 for No Edge) b) Sketch an undirected graph of the above designed adjaceney matrix.
Q: Single elements of a matrix are accessed as A(i,j), where 1 ≥ i and 1 ≥ j O True O False
A: In MATLAB, the access a single element of matrix, specify the row number followed by the column…
Q: Q.No.2: a) Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Name : - MUHAMMAD BILAL Alphabets M U H A D _ B I L M 0 0 0 0 0 1 0 0 0 U 0 0 0 0 0 1 0 0 0…
Q: 2. Create a matrix M that looks like the following: Using nested for loops and if statements, and…
A: % Defining vectorM = [0 8 11 14 17 ; 0 1 11 14 17 ; 1 2 0 14 4 ];disp('Matrix is')disp(M) % Display…
Q: First, write down a MATLAB line / statement which creates a matrix named Mat_C containing random…
A: The Matlab code and the output screenshot has been given in step 2.
Q: ) Design an adjacency Matrix of the alphabets of your full name. In accordance with the following…
A: Actually, given information: If your name has repeated characters (e.g. character E, 2 times) then…
Q: What to input here to run properly? % Encode the Matrix A and the column vector b. A= b= % Solve…
A: Answer: I have given answer in the first three subpart form the first part. we have some own…
Q: Q2/ Using C++, write a program that reads the values of the elements of a square matrix m x m, then…
A: C++ program to solve the given problem is below.
Q: In a company, there are several branches. Let us consider a branch of that company having N…
A: PROGRAM: The program makes use of Scanner class defined in java.util package to take user inputs. It…
Q: Let us illustrate the above algorithm using a concrete example. As shown in Fig. 13.4.2 (left),…
A: Below find the matlab code #@save def assign_anchor_to_bbox(ground_truth, anchors, device,…
Q: Design an adjacency Matrix of the alphabets of your full name. In accordance with the following…
A: Actually, given question regarding: Design an adjacency Matrix of the alphabets of your full name.…
Q: In a company, there are several branches. Let us consider a branch of that company having N…
A: Step 1- The program makes use of Scanner class defined in java.util package to take user inputs. It…
Q: java take a matrix from user and and check whether it is identity matrix or not matrix
A: Approach : we take the matrix and check the diagonal entry if it is 1 and other entries are 0 .then…
Q: IMPORTANT: For part 3, implement an iterative dynamic programming solution. You are driving from…
A: The required code in Python3 for the given problem: #function to find minimum toll def…
Q: 2.Write a C++ program that will load a 2-dimensional array A (4x4 matrix) with random numbers(range:…
A: Program code: //include the header files #include <cstdlib> #include <ctime>…
Q: Design an adjacency Matrix of the alphabets of my name (Isha Tir Razia). In accordance with the…
A: Adjacency Matrix is a matrix A[n][n] where n is the number of vertices, such that: a[i][j] = 1 if i…
Q: e } and Q = { a,q,r,s,e }, how
A: Given If P = { a,b,c,d,e } and Q = { a,q,r,s,e }, how many members has (P U Q) ?
Q: 1. Draw a Venn diagram to illustrate the below set operations by shading each operation separately…
A: A Venn diagram uses overlapping circles to illustrate the logical relationships between two or more…
Q: Design a class to perform various matrix operations. A matrix is a set of numbers arranged in rows…
A: Code: #include <bits/stdc++.h>using namespace std;//class Matrix_Typeclass Matrix_Type{…
Q: Given a non-empty vector of double / floating point type values vec, the following Matlab expression…
A: Given the MATLAB expression find(vec > 2) and we have to find will the expression FIND and…
Q: Q3: Consider the scores of 12 students in Computer course (X) and Mathematic course (Y) given as…
A: Note: Answering the first three subparts. Task : Create the matrix. Perform the first three given…
Q: (Row Replacement) Another very common row operation from lincar algebra is the row replacement.…
A: function mat_B = row_replace(mat_A,i,j,alpha)mat_B=mat_A;mat_B(i,:)=mat_B(i,:)+alpha*mat_B(j,:);end
Q: Q. No.2:| a) Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Let the name is SOPHIA Adjacency Matrix will be Alphabets S O P H I A S 0 0 0 0 0 0 O 0 0 0 0…
Q: (3) Start with a 4 by 4 matrix A whose entries are integers in the range from 1 to 10 (output A).…
A:
Q: Checking the overlap status of the courses on the same day in the curriculum in a section will be…
A: The code in C has been given in step 2.
Q: The table of the football championship is given by a square matrix of order n, in which all elements…
A: (1)First we need to read the value of 'n', then we need to create a 2D dynamic array (2)Now we need…
Q: A bracket is considered to be any one of the following characters: (, ), {, }, [, or ]. We consider…
A: import java.util.ArrayDeque;import java.util.Deque;public class BracketMatching { public static void…
Q: Problem 1) Change the diagonal elements of a 3X3 matrix to 1. Diagonal elements of the example…
A: #include <iostream> using namespace std; const int MAX = 100; // to print the resultant…
Q: # stack the following list vertically with ones matrix and transpose it mat = [1, 5, 3, 7, 8] [[1.…
A: - We have to create the list shown with 1's appended and them we have to transpose it. - We are…
Q: Candidate Boris is going to have a small walk. Bytetown can be represented as N- dimensional cube…
A: Here is the detailed and simplified C++ code for the above listed problem statement:
Q: Question 3 Write a MATLAB code to implement the following: (a) Create a 3 x 3 random matrix, named A…
A: Answering first part as per the guidelines. The problem is based on the basics of matrices in matlab…
Q: 6) Precedence graphs are directed graphs that have been used for data base management as well as…
A: According to the question, we have to draw a precedence graph for the given program and The…
Q: You are to choose between a linked list and an array data structure. a. Explain why you would choose…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Design an adjacency Matrix of the alphabets of Uzair Bhatti . In accordance with the following…
A: Name: - Uzair Bhatti Adjacency Matrix: - Alphabets U z a i r _ B h t U 0 0 0 0 0 1 0 0 0 z 0…
Q: Exercise 2. True or False (give a counterexample when False) a. The vectors b that are not in column…
A: As per the asked question, the proper solution is solved below:
Q: Explain the worst-case, average-case and best-case analysis for the below program. (i)…
A: Please give positive ratings for my efforts. Thanks. ANSWER Here, For searching the element in…
Q: Let mxn be a matrix of 0 and 1 values. Write the C program that finds the shortest path from 0x0 to…
A: C code :- #include <stdio.h> // Maze size #define N 6#define M 12 bool…
Q: Write a code in "C"that can swap all the values of its first row with its last row in a [n×m] matrix…
A: nxm is a row and columns. The matrix is a two-dimensional array. Initially, the matrix size is 100…
Q: Q1 a. Design an adjacency Matrix of the alphabets of your full name “Ghazi Messam”. In accordance…
A: Adjacency Matrix Alphabets G h a z i _ M e s G 0 0 0 0 0 1 0…
Q: Design an adjacency Matrix of the alphabets of your full name. In accordance with the following…
A: Answer: Given name: Rana awais Step 1: If your name has repeated characters (e.g. character E, 2…
Q: Given a square matrix of size ?×?n×n that only contains integers, compute the sum of the two…
A: Here I have defined the function sum_of_diagonals(). In this function, I have extracted the…
Q: Input: a list of pairs, L. Interpreting L as a binary relation, Transitive? returns #t if L is a…
A: Here is the answer:-
Q: Write a C++ program that will dynamically allocate a 2D array of size MxN, where M and N will be…
A: C++ program to solve the given problem is below.
Q: Q2 / Using C++, write a program that reads the values of the elements of a square matrix m x m, then…
A: #include <iostream>using namespace std; int main(){ int m; cout<<"Enter size of…
Q: Q.No.2: a. Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Suppose the name is Jan Smith 1. There is no repeated characters. 2. There is only S in the name…
Q: Question 1: Choose the correct option: 1-The most common way of repeating a sequence of statements…
A: 1) When there is repeated sequence of statement for specific time for loop is used. With a for loop…
Q: Suppose, you are given two matrices (A and B) as input, you have to perform the following tasks: I.…
A: According to Bartleby policy, we will answer only the first 3 questions Attaching the code and…
Q: Q.No.2: a) Design an adjacency Matrix of the alphabets of your full name(Let Take RUWISH-ZAHOOR). In…
A:
Q: 1. Trace the execution of the following: int[] anArray for (int i = 3; i 3; i--) 1]; anArray[i]…
A: Part(a) In this case, the content of the array starting from index 0 to 7 are 0 1 2 3 4 5 6 7. Now,…
Q: 1 1. Let A = 204 1 3 6 13 7 a) What size is A? b) What is the third column of A? c) What is the…
A: What size is A ? --> This sturcture is called as the matrix . Which consist of the rows and the…
Step by step
Solved in 2 steps with 1 images
- Q.No.2: a. Design an adjacency Matrix of the alphabets of your full name. In accordance with the following conditions: If your name has repeated characters (e.g. character E, 2 times) then you will consider only 1 time. If your Name contains both G and S, then there will be an edge between them and one additional edge from W to each if W is also in your name. If N is the alphabet in your name, it will have an edge to A and S if it available in your name. If P is available then it will have an edge with L if it is available. If there is a blank space in full Name then it will be represented by “_”, and it must have an edge with all alphabets. (Note: Place on in 1 for Edge and 0 for No Edge) b. Sketch an undirected graph of the above designed adjacency matrix.Q.No.2: Design an adjacency Matrix of the alphabets of your full name. In accordance with the following conditions: If your name has repeated characters (e.g. character E, 2 times) then you will consider only 1 time. If your Name contains both G and S, then there will be an edge between them and one additional edge from W to each if W is also in your name. If N is the alphabet in your name, it will have an edge to A and S if it available in your name. If P is available then it will have an edge with L if it is available. If there is a blank space in full Name then it will be represented by “_”, and it must have an edge with all alphabets. suppose your name is Rana awais (Note: Place on in 1 for Edge and 0 for No Edge) Sketch an undirected graph of the above designed adjacency matrix.a) Design an adjacency Matrix of the alphabets of your full name. In accordance with the following conditions:• If your name has repeated characters (e.g. character E, 2 times) then you will consider only 1 time.• If your Name contains both G and S, then there will be an edge between them and one additional edge from W to each if W is also in your name. • If N is the alphabet in your name, it will have an edge to A and S if it available in your name.• If P is available then it will have an edge with L if it is available.• If there is a blank space in full Name then it will be represented by “_”, and it must have an edge with all alphabets.(Note: Place on in 1 for Edge and 0 for No Edge)b) Sketch an undirected graph of the above designed adjacency matrix.
- The compass gradient operators of size 3x3 are designed to measure gradients of edges oriented in eight directions: E, NE, N, NW, W, SW, S, and SE. i) Give the form of these eight operators using coefficients valued 0, 1 or – 1. ii) Specify the gradient vector direction of each mask, keeping in mind that the gradient direction is orthogonal to the edge direction.You are the chief commander of US Army; you have been deployed in an ongoing war training of defusing the mine. Mines are placed on the ground which can be considered as a gird of size N*M. Each block (i, j) has a mine in it if and only if the summation of the block coordinates is divisible by 2. Your task is to move from the first row to the last row. The mines will not blow if the given rules are followed: • If you are on even row you can move to any cell that is in the neighborhood • If you are on odd row, you can only go the odd row that has mine on that and same with the unmined row. You have to develop a python program to calculate the number of ways to reach row number N starting from row number 1. Test Cases: 4 8 Output: 10Q3 In a company, there are several branches. Let us consider a branch of that company having N employees, if the manager is allotted to that branch(s) then he is known to everyone else in that branch. Note that the property of "known to everyone" is unique to a manager. Your task is to find the manager in that branch. Input from the user in main (), the square matrix M where if an element of row i and column j is set to 1 it means that ith person knows jth person. You need to write a function managerId () which returns the id of the manager if present or else returns -1. The function managerId () takes two arguments - the square matrix of N *N and its size N. Call managerId () from the main () output the information about the manager. Assume all diagonal elements to be 1 (as everyone knows him/herself) and there is at most one manager in the company. Example: No of persons N = 3 Input matrix: 0 1 1 1 0 1 Output: manager is person 3 1 0 1
- On a chess board of r rows and c columns there is a lone white rook surrounded by a group of opponent's black knights. Each knight attacks 8 squares as in a typical chess game, which are shown in the figure - the knight on the red square attacks the 8 squares with a red dot. The rook can move horizontally and vertically by any number of squares. The rook can safely pass through an empty square that is attacked by a knight, but it must move to a square that is not attacked by any knight. The rook cannot jump over a knight while moving. If the rook moves to a square that contains a knight, it may capture it and remove it from the board. The black knights. never move. Can the rook eventually safely move to the designated target square? The figure illustrates how the white rook can move to the blue target square at the top-right corner in the first sample case. The rook captures one black knight at the bottom-right of the board on its way. Rok nd kight lcoes by Chunen Input The first line…True or False 1. Matrices are often represented by single small letters a, b, c... etc.2. Two m x n matrices A and B are equal if aij=bij for each i & j. (i.e., the two matrices havesame size, and all the corresponding elements are equal).3. Matrices A & B are said to be conformable in the order AB if, and only if, the number ofrows in A is equal to the number of columns in B.4. Suppose Matrix A is having 4 rows and 3 columns, and Matrix B is having 3 rows and 2columns. The product size of AB is a 4 x 2 matrix.5. Suppose B is the matrix obtained from an n x n matrix A by multiplying the entries in arow/column by a non-zero constant and adding the result to the corresponding entries inanother row/column. Then, det(B) = det(A).write a C++ program to Given a matrix of dimension m*n where each cell in the matrix can have values 0, 1 or 2 whichhas the following meaning:0: Empty cell1: Cells have fresh oranges2: Cells have rotten orangesSo we have to determine what is the minimum time required so that all the oranges becomerotten. A rotten orange at index [i,j] can rot other fresh orange at indexes [i-1,j], [i+1,j], [i,j-1],[i,j+1] (up, down, left and right). If it is impossible to rot every orange then simply return -1.Examples:Input: arr[][C] = { {2, 1, 0, 2, 1},{1, 0, 1, 2, 1},{1, 0, 0, 2, 1}};Output:All oranges can become rotten in 2 time frames.Input: arr[][C] = { {2, 1, 0, 2, 1},Tahir Iqbal Department of Computer Sciences. BULC{0, 0, 1, 2, 1},{1, 0, 0, 2, 1}};Output:All oranges cannot be rotten.Below is algorithm.1) Create an empty Q.2) Find all rotten oranges and enqueue them to Q. Also enqueuea delimiter to indicate beginning of next time frame.3) While Q is not empty do following3.a) While delimiter in…
- use my ID : 201909010 SOLVE ALL BY matlab Consider the graphs of the functions f(x) = m - 1x and g(x) = 2x² — n where m and n are the maximum and mean values of the digits in your student-ID number. a) Create a vector v whose elements are the digits of your student-ID number. b) Create a variable m and assign the maximum digit in v to it. Create a variable n and assign the mean value of the digits in v to it. d) Define the function f(x) and g(x) above as anonymous functions. Plot the graphs of f(x) and g(x) on the same figure using the MATLAB function ezplot. f) Find the exact values of the x-coordinates of the intersection points between the two graphs using the MATLAB function solve. g) Find the area bounded by the two graphs.HW 3: Given the regular expression ((a/b)(abb)): • Construct an equivalent NFA using Thompson's construction. • Convert this NFA to a DFA using the subset construction method.In a company, there are several branches. Let us consider a branch of that company having N employees, if the manager is allotted to that branch(s) then he is known to everyone else in that branch. Note that the property of "known to everyone" is unique to a manager. Your task is to find the manager in that branch. Input from the user in main (), the square matrix M where if an element of row i and column j is set to 1 it means that ith person knows jth person. You need to write a function managerId () which returns the id of the manager if present or else returns -1. The function managerId () takes two arguments - the square matrix of N *N and its size N. Call managerId () from the main () output the information about the manager. Assume all diagonal elements to be 1 (as everyone knows him/herself) and there is at most one manager in the company.