Questions
PYTHON ONLY NO JAVA! PLEASE INCLUDE PSEUDOCODE AS WELL! Program 4: Design (pseudocode) and implement (source...

PYTHON ONLY NO JAVA! PLEASE INCLUDE PSEUDOCODE AS WELL!

Program 4: Design (pseudocode) and implement (source code) a program (name it LargestOccurenceCount) that read from the user positive non-zero integer values, finds the largest value, and counts it occurrences. Assume that the input ends with number 0 (as sentinel value to stop the loop). The program should ignore any negative input and should continue to read user inputs until 0 is entered. The program should display the largest value and number of times it appeared as shown below in this sample runs. Document your code and properly label the input prompts and the outputs as shown below.

Sample run 1:

Enter positive integers (0 to quit): 3 4 5 -9 4 2 5 1 -5 2 5 0

Largest value: 5

Occurrences:   3 times

Sample run 2:

Enter positive integers (0 to quit): 3 7 5 -4 4 2 -5 5 1 7 0

Largest value: 7

Occurrences:   2 times

Sample run 3:

Enter positive integers (0 to quit): 2 9 8 -4 8 9 -5 8 9 1 7 7 9 0

Largest value: 9

Occurrences:   4 times

In: Computer Science

It is known that the mean time to solve the puzzle in healthy control children is...

It is known that the mean time to solve the puzzle in healthy control children is 60 seconds. Carry out the Wilcoxon signed-rank test on these data to test the null hypothesis that the mean time to solve the puzzle for children with NF1 is the same as for healthy controls.

a) Calculate the value of the test statistic and give the approximate normal distribution of the test statistic under the null hypothesis.

b) Calculate the p-value for the test assuming a two-sided alternative hypothesis.

c) What do you conclude about the time taken by children with NF1 to solve the puzzle compared to healthy controls?

d) Describe in a few sentences how you would calculate a 95% confidence interval for the mean time without assuming any particular parametric model for the data. You do not need to calculate the interval.

Provided data is:-

ID   yi
1   51
2   60
3   75
4   43
5   92
6   72
7   49
8   39
9   62
10   127
11   51
12   75
13   69
14   59
15   25
16   58
17   95
18   63
19   91
20   63
21   32
22   50
23   108
24   41
25   93
26   43
27   74
28   50
29   55
30   60
31   62
32   91
33   79
34   71
35   85
36   86
37   78
38   100
39   146
40   62
41   134
42   41
43   40
44   51
45   68
46   59
47   59
48   38
49   66
50   79
51   111
52   69
53   68
54   110
55   69
56   62
57   91

In: Statistics and Probability

5. Write a C++ statement or statements that will:       Print the first two digits and the  last...

5. Write a C++ statement or statements that will:      

Print the first two digits and the  last two digits of any 4 digit number stored in an integer variable n.        

For example, given int n = 5623, print

56    23.

6. Write  C++ statements that will align the following three lines as printed in two 20 character columns.

Name                                                 Years President

Abraham Lincoln                                 1860-1865

Thomas Jefferson                               1801-1809

7.  Write a C++ statement or statements that will Output if a string has a length greater than 10, equal to 10 or less than 10.

Examples  :    

string str1 = “Four Score and Seven Years Ago”      would output “String Length > 10”

string str2 = “Good Day”                                            would output “String Length < 10”

string str3 = 0123456789”                                          would output “String Length = 10”

In: Computer Science

Alice and Bob are discussing Alice’s healthy eating. They suspect Eve is listening in, so they...

Alice and Bob are discussing Alice’s healthy eating. They suspect Eve is listening in, so they use double encryption. Message blocks are eight bits. Each block encodes a character using ASCII.

A block is first encrypted by flipping a single bit (changing 1 to 0 or 0 to 1). The key is a value from 0 to 7 and says which bit to flip. So if the key is 5, bit number 5 in each 8-bit block is flipped. Number bits from 0 to 7, starting at the right bit. (The book sometimes numbers bits in the other direction.)

The second key is a value from 0 to 7 and says how much to rotate the block left. So if the key is 2, blocks are rotated left by two bit positions.

Here is a plaintext block for ‘A’ : 0100 0001. Say the key is (4, 3). First flip bit 4: 0101 0001, and then rotate left by three: 1000 1010.

Eve intercepts the message

0000 1010 0010 1010 1000 0010 0111 1010 0010 1010 0100 0010 0000 1010

She suspects the first three blocks encode EAT. She knows the two ciphers that Alice and Bob are using, but does not know the two keys. Exhaustive search would require trying up to 8x8 = 64 key pairs until the first three blocks deciphered to EAT.

So she uses a known plaintext attack with Meet-in-the-Middle

Plaintext:   EAT

bit to flip

A: block as 24 bits

B: Col A in hex

none

0

1

2

3

4

5

6

7

Fill in the table by enciphering the first three blocks (1 byte each) of the known plaintext using the first cipher. The row labeled none is the 24 bits of unenciphered plaintext.

Now, fill in the second table by deciphering the first three blocks of the intercepted ciphertext using the second cipher. You are de-ciphering, so the rotation is right. There should be a match in column D to a cell in column B. Now Eve has the full key.

C

D

Second key (rotation)

First 3 half-deciphered blocks in binary

Column C in hex

0

1

2

3

4

5

6

7

Use the full key to decipher the message. What is the secret that Alice sent to Bob?

  1. Last four blocks of the secret message (from above):
  1. Last four ciphertext blocks (i) half-deciphered using the rotation that matched column D:
  1. Last four ciphertext blocks (ii) completely deciphered by un-flipping the bit determined by the match with column B:
  1. Above (iii) bit patterns as hex
  1. ASCII characters represented by the (iv).
  1. Full message sent from Alice to Bob:
  1. Are you going to take Alice’s advice?

In: Computer Science

Please answer all of them Pough Publishing Company produces books for the retail market. Demand for...

Please answer all of them

Pough Publishing Company produces books for the retail market. Demand for a current book is expected to occur at a constant annual rate of 7200 copies. The cost of one copy of the book is $14. 50. The holding cost is based on an 18% annual rate, and production set up costs are $150 per set up. The equipment on which the book is produced has an annual production volume of 25,000 copies. Pough has 250 working days per year, and the lead time for a production run is 15 days. Use the production lot size model to compute the following values:

  1. Minimum cost production lot size
  2. Number of production runs per year
  3. Cycle time
  4. Length of a production run
  5. Maximum inventory
  6. Total annual cost
  7. Reorder point

In: Operations Management

The Rams are playing the Aggies in the last conference game of the season. The Rams...

  1. The Rams are playing the Aggies in the last conference game of the season. The Rams are trailing the Aggies 21 to 14 with 7 seconds left in the game, when they score a touchdown. Still trailing 21 to 20, the Rams can either go for two points and win or go for one point to send the game into overtime. The conference championship will be determined by the outcome of this game. If the Rams win, they will go to the Candy Ball with a payoff of $6.4 million; if they lose they go to the Crocodile Bowl with a payoff of $1.2 million. If the Rams go for two points there is 30% chance they will be successful and 70% chance they will fail and lose. If they go for one point there is a 0.97 probability of success and 0.03 probability of failure. If they tie they will play overtime, in which the Rams have a 40% of winning because of fatigue.

  1. Draw a decision tree for this problem.
  2. What should the Rams do to achieve the highest expected monetary value (EMV) and what is the EMV?
  3. What would the Rams’ probability of winning the game in overtime have to be to make the Rams indifferent between going for one point or two points?

In: Advanced Math

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions...

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions of a special reel used for river fishing. The two models are the M-008, a basic reel, and the M-123, a new and improved version. Cost accountants at company headquarters have prepared costs for the two reels for the most recent period. The plant manager is concerned. The cost report does not coincide with her intuition about the relative costs of the two models. She has asked you to review the cost accounting and help her prepare a response to headquarters.

Manufacturing overhead is currently assigned to products based on their direct labor costs. For the most recent month, manufacturing overhead was $298,400. During that time, the company produced 12,900 units of the M-008 and 2,300 units of the M-123. The direct costs of production were as follows:

M-008 M-123 Total
Direct materials $ 103,200 $ 92,000 $ 195,200
Direct labor 103,200 46,000 149,200

Management determined that overhead costs are caused by three cost drivers. These drivers and their costs for last year were as follows:

Activity Level
Cost Driver Costs M-008 M-123 Total
Number of machine-hours $ 116,900 8,000 2,000 10,000
Number of production runs 90,000 20 20 40
Number of inspections 91,500 20 35 55
Total overhead $ 298,400

Required:

a. How much overhead will be assigned to each product if these three cost drivers are used to allocate overhead? What is the total cost per unit produced for each product? (Round your intermediate calculations and final answers to 2 decimal places.)

b. How much of the overhead will be assigned to each product if direct labor cost is used to allocate overhead? What is the total cost per unit produced for each product? (Round "Total unit cost" to 2 decimal places.)

In: Accounting

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions...

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions of a special reel used for river fishing. The two models are the M-008, a basic reel, and the M-123, a new and improved version. Cost accountants at company headquarters have prepared costs for the two reels for the most recent period. The plant manager is concerned. The cost report does not coincide with her intuition about the relative costs of the two models. She has asked you to review the cost accounting and help her prepare a response to headquarters.

Manufacturing overhead is currently assigned to products based on their direct labor costs. For the most recent month, manufacturing overhead was $328,000. During that time, the company produced 15,000 units of the M-008 and 2,200 units of the M-123. The direct costs of production were as follows:

M-008 M-123 Total
Direct materials $ 120,000 $ 88,000 $ 208,000
Direct labor 120,000 44,000 164,000

Management determined that overhead costs are caused by three cost drivers. These drivers and their costs for last year were as follows:

Activity Level
Cost Driver Costs M-008 M-123 Total
Number of machine-hours $ 154,000 8,000 2,000 10,000
Number of production runs 80,000 20 20 40
Number of inspections 94,000 25 35 60
Total overhead $ 328,000

Required:

a. How much overhead will be assigned to each product if these three cost drivers are used to allocate overhead? What is the total cost per unit produced for each product? (Round your intermediate calculations and final answers to 2 decimal places.)

b. How much of the overhead will be assigned to each product if direct labor cost is used to allocate overhead? What is the total cost per unit produced for each product? (Round "Total unit cost" to 2 decimal places.)

In: Accounting

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions...

Doaktown Products manufactures fishing equipment for recreational uses. The Miramichi plant produces the company’s two versions of a special reel used for river fishing. The two models are the M-008, a basic reel, and the M-123, a new and improved version. Cost accountants at company headquarters have prepared costs for the two reels for the most recent period. The plant manager is concerned. The cost report does not coincide with her intuition about the relative costs of the two models. She has asked you to review the cost accounting and help her prepare a response to headquarters.

Manufacturing overhead is currently assigned to products based on their direct labor costs. For the most recent month, manufacturing overhead was $330,400. During that time, the company produced 14,400 units of the M-008 and 2,500 units of the M-123. The direct costs of production were as follows:

M-008 M-123 Total

Direct materials $ 115,200 $ 100,000 $ 215,200

Direct labor 115,200 50,000 165,200

Management determined that overhead costs are caused by three cost drivers. These drivers and their costs for last year were as follows:

Activity Level

Cost Driver Costs M-008 M-123 Total

Number of machine-hours $ 153,900 1,000 9,000 10,000

Number of production runs 80,000 20 20 40

Number of inspections 96,500 15 30 45

Total overhead $ 330,400

Required:

a. How much overhead will be assigned to each product if these three cost drivers are used to allocate overhead? What is the total cost per unit produced for each product? (Round your intermediate calculations and final answers to 2 decimal places.)

b. How much of the overhead will be assigned to each product if direct labor cost is used to allocate overhead? What is the total cost per unit produced for each product? (Round "Total unit cost" to 2 decimal places.)

In: Accounting

Describe an efficient recursive algorithm for solving the element uniqueness problem

Describe an efficient recursive algorithm for solving the element uniqueness problem, which runs in time that is at most O(n2) in the worst case without using sorting.

 

 

In: Computer Science