Questions
4. Consider the random variable Z from problem 1, and the random variable X from problem...

4. Consider the random variable Z from problem 1, and the random variable X from problem 2.

Also let f(X,Z)represent the joint probability distribution of X and Z.  f is defined as follows:

f(1,-2) = 1/6
f(2,-2) = 2/15
f(3,-2) = 0
f(4,-2) = 0
f(5,-2) = 0
f(6,-2) = 0
f(1,3) = 0
f(2,3) = 1/30
f(3,3) = 1/6
f(4,3) = 0
f(5,3) = 0
f(6,3) = 0
f(1,5) = 0
f(2,5) = 0
f(3,5) = 0
f(4,5) = 1/6
f(5,5) = 1/6
f(6,5) = 1/6

Compute the covariance of X and Z.

Then, compute the correlation coefficient of X and Z. (Note: You will need values that you computed in problems 1 and 2.)

These are questions 1 and 2.

1. Let Z be a random variable with the following probability distribution f:

f(-2) = 0.3
f(3) = 0.2
f(5) = 0.5

Compute the E(Z), Var(Z) and the standard deviation of Z.

2. Tossing a fair die is an experiment that can result in any integer number from 1 to 6 with equal probabilities. Let X be the number of dots on the top face of a die. Compute E(X) and Var(X).

In: Statistics and Probability

Use the given data set to answer parts​ (a) and​ (b). a. Find the regression equation...

Use the given data set to answer parts​ (a) and​ (b).

a.

Find the regression equation for the data points.

b.

Graph the regression equation and the data points.

x

5

4

33

1

2

y

0

2

0

4

6

a.

Find the regression equation for the data points.

In: Statistics and Probability

Journalize transactions from account data and prepare a trial balance. (LO 2, 4) The T-accounts below...

Journalize transactions from account data and prepare a trial balance.

(LO 2, 4)

The T-accounts below summarize the ledger of Daggett Landscaping Company at the end of the first month of operations.

Cash No. 101 Unearned Service Revenue No. 209
4/1 12,000 4/15 1,300 4/30 1,000
4/12 900 4/25 1,500
4/29 400
4/30 1,000
Accounts Receivable No. 112 Owner's Capital No. 301
4/7 3,200 4/29 400 4/1 12,000
Supplies No. 126 Service Revenue No. 400
4/4 1,800 4/7 3,200
4/12 900
Accounts Payable No. 201 Salaries and Wages Expense No. 726
4/25 1,500 4/4 1,800 4/15 1,300

In: Accounting

I don't know why I keep getting the following error: AttributeError: 'tuple' object has no attribute...

I don't know why I keep getting the following error:

AttributeError: 'tuple' object has no attribute 'size'

I am using python in Anaconda.

import numpy as np

def information_gain(x_array, y_array):
parent_entropy = entropy(x_array)
split_dict = split(y_array)
for val in split_dict.values():
freq = val.size / x_array.size
child_entropy = entropy([x_array[i] for i in val])
parent_entropy -= child_entropy* freq
return parent_entropy

x = np.array([0, 1, 0, 1, 0, 1])
y = np.array([0, 1, 0, 1, 1, 1])
print(round(information_gain(x, y), 4))
x = np.array([0, 0, 1, 1, 2, 2])
y = np.array([0, 1, 0, 1, 1, 1])
print(round(information_gain(x, y), 4))

In: Computer Science

From Recording Transactions (Including Adjusting Journal Entries) to Preparing Financial Statements and Closing Journal Entries (Chapters...

From Recording Transactions (Including Adjusting Journal Entries) to Preparing Financial Statements and Closing Journal Entries (Chapters 2, 3, and 4) [LO 2-3, LO 3-3, LO 4-1, LO 4-2, LO 4-3, LO 4-4, LO 4-5, LO 4-6]

[The following information applies to the questions displayed below.]

Brothers Harry and Herman Hausyerday began operations of their machine shop (H & H Tool, Inc.) on January 1, 2013. The annual reporting period ends December 31. The trial balance on January 1, 2015, follows (the amounts are rounded to thousands of dollars to simplify):
  Account Titles Debit Credit
  Cash $ 2
  Accounts Receivable 6
  Supplies 13
  Land 0
  Equipment 67
  Accumulated Depreciation $ 5
  Software 21
  Accumulated Amortization 7
  Accounts Payable 4
  Notes Payable (short-term) 0
  Salaries and Wages Payable 0
  Interest Payable 0
  Income Tax Payable 0
  Common Stock 84
  Retained Earnings 9
  Service Revenue 0
  Salaries and Wages Expense 0
  Depreciation Expense 0
  Amortization Expense 0
  Income Tax Expense 0
  Interest Expense 0
  Supplies Expense 0
     Totals $ 109 $ 109
Transactions during 2015 (summarized in thousands of dollars) follow:
1. Borrowed $11 cash on a six-month note payable dated March 1, 2015.
2. Purchased land for future building site; paid cash, $8.
3. Earned revenues for 2015, $174, including $47 on credit and $127 collected in cash.
4. Issued additional shares of stock for $4.
5. Recognized salaries and wages expense for 2015, $92 paid in cash.
6. Collected accounts receivable, $31.
7. Purchased software, $11 cash.
8. Paid accounts payable, $12.
9. Purchased supplies on account for future use, $19.
10. Signed a $20 service contract to start February 1, 2016.
Data for adjusting journal entries:
11. Unrecorded amortization for the year on software, $7.
12. Supplies counted on December 31, 2015, $12.
13. Depreciation for the year on the equipment, $5.
14. Accrued interest of $1 on notes payable.
15. Salaries and wages earned but not yet paid or recorded, $13.
16. Income tax for the year was $7. It will be paid in 2016.

INCLUDE journal entires, adjusting journal entires, T-accounts,unadjusted trial balance, adjusted trial balance,income statement, statement of retained earnings, closing journal entry, post-closing trial balance

In: Accounting

Use SPSS® to check your mock data for the following: Assumptions of normality (Shapiro-Wilk) Homogeneity of...

Use SPSS® to check your mock data for the following:

  • Assumptions of normality (Shapiro-Wilk)
  • Homogeneity of variance (Lavene)
  • Outliers
  • Skewness/Kurtosis

sex film arousal
1 1 47
1 1 38
1 1 41
1 1 35
1 1 43
1 1 49
1 1 38
1 1 39
1 1 44
1 1 48
1 2 25
1 2 8
1 2 4
1 2 16
1 2 15
1 2 6
1 2 20
1 2 12
1 2 9
1 2 23
2 1 23
2 1 35
2 1 25
2 1 36
2 1 33
2 1 40
2 1 31
2 1 39
2 1 35
2 1 27
2 2 18
2 2 13
2 2 19
2 2 24
2 2 11
2 2 2
2 2 9
2 2 19
2 2 10
2 2 2

In: Statistics and Probability

Gatson manufacturing company produces 2 types of tires: Economy tire; Premium tire. The manufacturing time and...

Gatson manufacturing company produces 2 types of tires: Economy tire; Premium tire. The manufacturing time and the profit contribution per tire are given in the following table.

Operation

Manufacturing Time (Hours)

Time Available

Economy tires

Premium tires

Hours

Material Preparation

4/3

1/2

600

Tire Building

4/5

1

650

Curing

1/2

2/4

580

Final Inspection

1/5

1/3

120

Profit/Tire

$12

$10

Answer the following assuming that the company is interested in maximizing the total profit contribution.

a. Develop a spreadsheet model and find the optimal solution using Excel Solver. What is the total profit contribution Gatson can earn with the optimal production quantities? Enter your answer without a dollar sign and rounded to two decimal places.

b. Based on your answer to Question 1, how many Economy tires should Gatson manufacture to maximize profit contribution? Round your answer to one decimal place.

c. Based on your answer to Question 1, how many Premium tires should Gatson manufacture to maximize profit contribution? Round your answer to one decimal place.

In: Operations Management

I NEED AN NLOGN OR LINEAR SOLUTION TO THIS PROBLEM! I NEED A FASTER SOLUTION THAN...

I NEED AN NLOGN OR LINEAR SOLUTION TO THIS PROBLEM!

I NEED A FASTER SOLUTION THAN THE ONE GIVEN BELOW!! The solution below runs in quadratic time, I need one faster than this.

I REPEAT I NEED A FASTER SOLUTION!! THE SOLUTION GIVEN BELOW IS TOO SLOW!

Slow Solution:

def predictAnswer(stockData, queries):
    stockData = [0] + stockData
    length = len(stockData)
    ans = []
    for q in queries:
        l = q-1
        r = q+1
        flag = True
        while l > 0 or r < length:
            if l > 0 and stockData[l] < stockData[q]:
                ans.append(l)
                flag = False
                break
            if r < length and stockData[r] < stockData[q]:
                ans.append(r)
                flag = False
                break
            l -= 1
            r += 1
        if flag:
            ans.append(-1)
    return ans

Question:

The function predictAnswer should be made based on the following.

In the prediction game, the first player gives the second player some stock market data for some consecutive days. The data contains a company's stock price on each day. The rules for the game are:

  1. Player 1 will tell player 2 a day number
  2. Player 2 has to find the nearest day on which stock price is smaller than the given day
  3. If there are two results, then player 2 finds the day number which is smaller
  4. If no such day exits, then the answer is -1.

Example 1;

stockData size n =10;

stockData = [5,6,8,4,9,10,8,3,6,4]

queries = [6,5,4]

Result is [5,4,8]

On day 6, the stock price is 10. Both 9 and 8 are lower prices one day away. Choose 9 (day 5) because it is before day 6. On day 5, the stock price is 9. 4 is the closest lower price on day 4. On day 4, the stock price is 4. The only lower price is on day 8. The return array is [5,4,8]

Example - 2

stockData size n = 10

stockData = [5,6,8,4,9,10,8,3,6,4]

queries = [3,1,8]

Result is [2,4,-1]

If the day number is 3.both days 2 and 4 are smaller.choose the earlier day,day 2.

If the day number is 1,day 4 is the closet day with a smaller price.

If the day number is 8,there is no day where the price is less than 3.

The return array is [2,4,-1]

/*

     * Complete the 'predictAnswer' function below.

     *

     * The function is expected to return an INTEGER_ARRAY.

     * The function accepts following parameters:

     *  1. INTEGER_ARRAY stockData

     *  2. INTEGER_ARRAY queries

     */

def predictAnswer(stockData, queries):

In: Computer Science

Year Name MinPressure_before Gender_MF Category alldeaths 1950 Easy 958 1 3 2 1950 King 955 0...

Year    Name    MinPressure_before      Gender_MF       Category        alldeaths
1950    Easy    958     1       3       2
1950    King    955     0       3       4
1952    Able    985     0       1       3
1953    Barbara 987     1       1       1
1953    Florence        985     1       1       0
1954    Carol   960     1       3       60
1954    Edna    954     1       3       20
1954    Hazel   938     1       4       20
1955    Connie  962     1       3       0
1955    Diane   987     1       1       200
1955    Ione    960     0       3       7
1956    Flossy  975     1       2       15
1958    Helene  946     1       3       1
1959    Debra   984     1       1       0
1959    Gracie  950     1       3       22
1960    Donna   930     1       4       50
1960    Ethel   981     1       1       0
1961    Carla   931     1       4       46
1963    Cindy   996     1       1       3
1964    Cleo    968     1       2       3
1964    Dora    966     1       2       5
1964    Hilda   950     1       3       37
1964    Isbell  974     1       2       3
1965    Betsy   948     1       3       75
1966    Alma    982     1       2       6
1966    Inez    983     1       1       3
1967    Beulah  950     1       3       15
1968    Gladys  977     1       2       3
1969    Camille 909     1       5       256
1970    Celia   945     1       3       22
1971    Edith   978     1       2       0
1971    Fern    979     1       1       2
1971    Ginger  995     1       1       0
1972    Agnes   980     1       1       117
1974    Carmen  952     1       3       1
1975    Eloise  955     1       3       21
1976    Belle   980     1       1       5
1977    Babe    995     1       1       0
1979    Bob     986     0       1       1
1979    David   970     0       2       15
1979    Frederic        946     0       3       5
1980    Allen   945     0       3       2
1983    Alicia  962     1       3       21
1984    Diana   949     1       2       3
1985    Bob     1002    0       1       0
1985    Danny   987     0       1       1
1985    Elena   959     1       3       4
1985    Gloria  942     1       3       8
1985    Juan    971     0       1       12
1985    Kate    967     1       2       5
1986    Bonnie  990     1       1       3
1986    Charley 990     0       1       5
1987    Floyd   993     0       1       0
1988    Florence        984     1       1       1
1989    Chantal 986     1       1       13
1989    Hugo    934     0       4       21
1989    Jerry   983     0       1       3
1991    Bob     962     0       2       15
1992    Andrew  922     0       5       62
1993    Emily   960     1       3       3
1995    Erin    973     1       2       6
1995    Opal    942     1       3       9
1996    Bertha  974     1       2       8
1996    Fran    954     1       3       26
1997    Danny   984     0       1       10
1998    Bonnie  964     1       2       3
1998    Earl    987     0       1       3
1998    Georges 964     0       2       1
1999    Bret    951     0       3       0
1999    Floyd   956     0       2       56
1999    Irene   987     1       1       8
2002    Lili    963     1       1       2
2003    Claudette       979     1       1       3
2003    Isabel  957     1       2       51
2004    Alex    972     0       1       1
2004    Charley 941     0       4       10
2004    Frances 960     1       2       7
2004    Gaston  985     0       1       8
2004    Ivan    946     0       3       25
2004    Jeanne  950     1       3       5
2005    Cindy   991     1       1       1
2005    Dennis  946     0       3       15
2005    Ophelia 982     1       1       1
2005    Rita    937     1       3       62
2005    Wilma   950     1       3       5
2005    Katrina 902     1       3       1833
2007    Humberto        985     0       1       1
2008    Dolly   963     1       1       1
2008    Gustav  951     0       2       52
2008    Ike     935     0       2       84
2011    Irene   952     1       1       41
2012    Isaac   965     0       1       5
2012    Sandy   945     1       2       159
Test if there is a significant difference in the death by Hurricanes and Min Pressure measured. Answer the questions for Assessment. (Pick the closest answer)

7. What is the P-value?

  • a. #DIV/0!
  • b. 0.384808843
  • c. 0.634755682
  • d. None of these

8. What is the Statistical interpretation?

  • a. The P-value is too large to have a conclusive answer.
  • b. The P-value is too small to have a conclusive answer.
  • c. ​​The P-value is much smaller than 5% thus we are certain that the average of hurricane deaths is significantly different from average min pressure.
  • d. None of the above.

9. What is the conclusion?

  • a. The statistics does not agree with the intuition since one would expect that stronger hurricanes to be deadlier.
  • b. ​​Statistical interpretation agrees with the intuition, the lower the pressure the stronger the hurricanes.
  • c. Statistics confirms that hurricanes’ pressure does relate to the death count.
  • d. The test does not make statistical sense, it compares “apples and oranges”.

In: Statistics and Probability

Open Hurricanes data. Test if there is a significant difference in the death by Hurricanes and...

Open Hurricanes data.

Test if there is a significant difference in the death by Hurricanes and Min Pressure measured. Answer the questions for Assessment. (Pick the closest answer)

7. What is the P-value?

  • a. #DIV/0!
  • b. 0.384808843
  • c. 0.634755682
  • d. None of these

8. What is the Statistical interpretation?

  • a. The P-value is too large to have a conclusive answer.
  • b. The P-value is too small to have a conclusive answer.
  • c. ​​The P-value is much smaller than 5% thus we are certain that the average of hurricane deaths is significantly different from average min pressure.
  • d. None of the above.

9. What is the conclusion?

  • a. The statistics does not agree with the intuition since one would expect that stronger hurricanes to be deadlier.
  • b. ​​Statistical interpretation agrees with the intuition, the lower the pressure the stronger the hurricanes.
  • c. Statistics confirms that hurricanes’ pressure does relate to the death count.
  • d. The test does not make statistical sense, it compares “apples and oranges”.

Year   Name   MinPressure_before   Gender_MF   Category   alldeaths
1950   Easy   958   1   3   2
1950   King   955   0   3   4
1952   Able   985   0   1   3
1953   Barbara   987   1   1   1
1953   Florence   985   1   1   0
1954   Carol   960   1   3   60
1954   Edna   954   1   3   20
1954   Hazel   938   1   4   20
1955   Connie   962   1   3   0
1955   Diane   987   1   1   200
1955   Ione   960   0   3   7
1956   Flossy   975   1   2   15
1958   Helene   946   1   3   1
1959   Debra   984   1   1   0
1959   Gracie   950   1   3   22
1960   Donna   930   1   4   50
1960   Ethel   981   1   1   0
1961   Carla   931   1   4   46
1963   Cindy   996   1   1   3
1964   Cleo   968   1   2   3
1964   Dora   966   1   2   5
1964   Hilda   950   1   3   37
1964   Isbell   974   1   2   3
1965   Betsy   948   1   3   75
1966   Alma   982   1   2   6
1966   Inez   983   1   1   3
1967   Beulah   950   1   3   15
1968   Gladys   977   1   2   3
1969   Camille   909   1   5   256
1970   Celia   945   1   3   22
1971   Edith   978   1   2   0
1971   Fern   979   1   1   2
1971   Ginger   995   1   1   0
1972   Agnes   980   1   1   117
1974   Carmen   952   1   3   1
1975   Eloise   955   1   3   21
1976   Belle   980   1   1   5
1977   Babe   995   1   1   0
1979   Bob   986   0   1   1
1979   David   970   0   2   15
1979   Frederic   946   0   3   5
1980   Allen   945   0   3   2
1983   Alicia   962   1   3   21
1984   Diana   949   1   2   3
1985   Bob   1002   0   1   0
1985   Danny   987   0   1   1
1985   Elena   959   1   3   4
1985   Gloria   942   1   3   8
1985   Juan   971   0   1   12
1985   Kate   967   1   2   5
1986   Bonnie   990   1   1   3
1986   Charley   990   0   1   5
1987   Floyd   993   0   1   0
1988   Florence   984   1   1   1
1989   Chantal   986   1   1   13
1989   Hugo   934   0   4   21
1989   Jerry   983   0   1   3
1991   Bob   962   0   2   15
1992   Andrew   922   0   5   62
1993   Emily   960   1   3   3
1995   Erin   973   1   2   6
1995   Opal   942   1   3   9
1996   Bertha   974   1   2   8
1996   Fran   954   1   3   26
1997   Danny   984   0   1   10
1998   Bonnie   964   1   2   3
1998   Earl   987   0   1   3
1998   Georges   964   0   2   1
1999   Bret   951   0   3   0
1999   Floyd   956   0   2   56
1999   Irene   987   1   1   8
2002   Lili   963   1   1   2
2003   Claudette   979   1   1   3
2003   Isabel   957   1   2   51
2004   Alex   972   0   1   1
2004   Charley   941   0   4   10
2004   Frances   960   1   2   7
2004   Gaston   985   0   1   8
2004   Ivan   946   0   3   25
2004   Jeanne   950   1   3   5
2005   Cindy   991   1   1   1
2005   Dennis   946   0   3   15
2005   Ophelia   982   1   1   1
2005   Rita   937   1   3   62
2005   Wilma   950   1   3   5
2005   Katrina   902   1   3   1833
2007   Humberto   985   0   1   1
2008   Dolly   963   1   1   1
2008   Gustav   951   0   2   52
2008   Ike   935   0   2   84
2011   Irene   952   1   1   41
2012   Isaac   965   0   1   5
2012   Sandy   945   1   2   159
                  

In: Statistics and Probability