Questions
In this program you will read a file specifying a directed graph G as a list...

In this program you will read a file specifying a directed graph G as a list of edges. Each edge u →v is listed on one line as u v. The input file simply lists the edges in arbitrary order as pairs of vertices, with each edge on a separate line. The vertices are numbered in order from 1 to the total number of vertices. The program outputs the out-degree sequence for GSCC in increasing order.

For example for the input below:

2 1

3 2

1 3

1 5

3 4

4 5

6 7

5 6

7 4

3 11

2 8

8 9

10 8

9 10

9 4

9 7

10 11

7 11

6 11

the corresponding output is:

0 1 2 3

You should be able to implement this program to run in linear time (time proportional to the total number of vertices plus the total number of edges in the input graph)

Use Kosaraju's Algorithm to find the SCC

Please code this in C

In: Computer Science

Use this constant dictionary as a global variable: tile_dict = { 'A': 1, 'B': 3, 'C':...

Use this constant dictionary as a global variable:

tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }

Implement function scrabblePoints(word) that returns the calculated points for the word based on the tile_dict above. The word parameter is a string. This function takes the string and evaluates the points based on each letter in the word (points per letter is set by the global dictionary). P or p is worth the same points. No points calculated for anything that is not A-Z or a-z.

[You may use upper() and isalpha() ONLY and no other method or built-in function]

Examples:

word = “PYTHON”

print(scrabblePoints(word))

returns:

14

word = “hello!!”

print(scrabblePoints(word))

returns:

8

word = “@#$=!!”

print(scrabblePoints(word))

returns:

0

In: Computer Science

Let X1 and X2 be independent identically distributed random variables with pmf p(0) = 1/4, p(1)...

Let X1 and X2 be independent identically distributed random variables with pmf p(0) = 1/4, p(1) = 1/2, p(2) = 1/4

(a) What is the probability mass function (pmf) of X1 + X2?

(b) What is the probability mass function (pmf) of X(2) = max{X1, X2}?

(c) What is the MGF of X1?

(d) What is the MGF of X1 + X2? (Note: The formulas we did were for the continuous case, so they don’t directly apply here, but you might find the ideas useful.)

In: Statistics and Probability

Consider the following 6 months of returns for 2 stocks and a portfolio of those 2​...

Consider the following 6 months of returns for 2 stocks and a portfolio of those 2​ stocks:

Jan

Feb

Mar

Apr

May

Jun

Copy to Clipboard +
Open in Excel +

  Stock A

2​%

5​%

−6​%

3​%

2​%

4​%

  Stock B

0​%

−3​%

8​%

1​%

4​%

2​%

  Portfolio

1​%

1​%

1​%

1​%

1​%

11​%

The portfolio is composed of​ 50% of Stock A and​ 50% of Stock B.  

a. What is the expected return and standard deviation of returns for each of the two​ stocks?

b. What is the expected return and standard deviation of returns for the​ portfolio?

c. Is the portfolio more or less risky than the two​ stocks? Why?

a. What is the expected return and standard deviation of returns for each of the two​ stocks?

The expected return of Stock A is___?  (Round to one decimal​ place.)

In: Finance

An investigator wonders if slow-tempo music is more complex than fast-tempo music – since with slower...

An investigator wonders if slow-tempo music is more complex than fast-tempo music – since with slower music, the listener has more time to process the incoming musical information. To study this, he examines three samples of pop songs by the Beatles that differ in tempo: slow (group 1), moderate (group 2), and fast (group 3). 20 Beatles songs are sampled in each category (so, 60 songs total). As a measure of musical complexity, the investigator counts the number of different chords that appear in each song (a chord is a group of notes played at the same time). He then compares the three tempo groups to see if they differ in average number of chords each song contains. Analyze the data using JASP, SPSS, or an online calculator, and answer the following question

do post hoc comparisons using Tukey’s HSD with a = 0.05. Report which means are reliably different, and what the basis for that decision is (in terms of the decision rule).

group

chords

1

9

1

9

1

10

1

11

1

11

1

11

1

12

1

12

1

12

1

13

1

13

1

13

1

14

1

14

1

14

1

14

1

14

1

15

1

17

1

19

2

5

2

5

2

6

2

6

2

6

2

7

2

7

2

7

2

8

2

8

2

8

2

9

2

9

2

9

2

9

2

10

2

10

2

11

2

12

2

14

3

2

3

4

3

4

3

4

3

5

3

6

3

6

3

6

3

6

3

7

3

7

3

7

3

7

3

8

3

9

3

9

3

9

3

10

3

10

3

11

In: Statistics and Probability

There are four organic acids below. Compare the acidities of four compounds and explain. 1. benzoic...

There are four organic acids below. Compare the acidities of four compounds and explain.

1. benzoic acid

2. 4-nitrophenol

3. 3-nitrophenol

4. 4-Methoxyphenol

In: Chemistry

We consider data in the following table, summarizing sales of a product (in thousands). For each...

We consider data in the following table, summarizing sales of a product (in thousands). For each of the questions, justify your answer. Year Quarter Sales 2015 1 2 3 4 4.95 4.25 6.15 6.65 2016 1 2 3 4 5.85 5.35 6.95 7.55 2017 1 2 3 4 6.15 5.75 7.65 7.95 (3.1) Assuming the given time-series shows evidence of seasonality, Determine the estimate sales values. (5) (3.2) What is the value of the root mean squared error for the given process? (5) (3.3) Ignoring seasonality and assuming the the time-series as given follows an AR(1) process, what is the expected sales value for the first quarter of 2018? (5)

In: Statistics and Probability

1. Calclulated the expected return of a portfolio that has 30% invested in stock X and...

1. Calclulated the expected return of a portfolio that has 30% invested in stock X and 70% in stock Y given the historical data below:

t Rx Ry
1 1% 5%
2 3% 6%
3 4% 9%

Record your answer in total return decimal format (e.g., 0.09 to represent 9%)

2. Calclulated the standard deviation of a portfolio that has 30% invested in stock X and 70% in stock Y given the historical data below:

t Rx Ry
1 1% 5%
2 3% 6%
3 4% 9%

Record your answer in total return decimal format (e.g., 0.09 to represent 9%)

3. Calculate the coefficient of variation of a portfolio that has 30% invested in stock X and 70% in stock Y given the historical data below:

t Rx Ry
1 1% 5%
2 3% 6%
3 4% 9%

Record your answer in decimal format.

In: Finance

Write a Java program that accepts a sequence of commands and print out the number of...

Write a Java program that accepts a sequence of commands and print out the number of successful insertions, the number of successful deletions, the number of successful searches (through the “find” command), the number of items remaining in the list after executing all commands and the final contents of the list.

Three commands that will be taken as inputs are “insert”, “delete” and “find”.

Input

Line 1: The number of transactions m on the list, where 1  m 200.

Line 2 to m+1: A string command (“insert”, “delete”, “find”) followed by an integer n (separated by a space).

  • “insert” means insert n into the list
  • “delete” means delete n from the list
  • “find” means find n in the list

Output

Line 1: Display 4 integers (each number is separated by a space) which are:

  • the number of successful insertions,
  • the number of successful deletions,
  • the number of successful search , and
  • the number of items remaining in the list

Line 2: The final contents of the list after executing all commands.

Sample Input

Sample Output

3

insert 1

delete 5

find 2

1 0 0 1

[ 1 ]

8

find 10

insert 3

insert 2

insert 1

delete 4

delete 3

insert 1

find 2

4 1 1 3

[ 1 1 2 ]

In: Computer Science

Two long, straight wires are separated by 2 m with wire 1 being on the left...

Two long, straight wires are separated by 2 m with wire 1 being on the left and wire 2 being on the right. Both wires carry currents of 8.5 A in opposite directions. Find the magnitude of the net magnetic field: a) 4 m to the left of wire 1 BL= __________ T b) In the middle, between both wires BM = __________ T c) 4 m to the right of wire 2 BR = __________ T

In: Physics