subject
Engineering, 25.02.2020 16:25 kluke7170

You have worked hard to collect snippets of stock data for training an AI to predict markets forday trading purposes. However, in a bout of sleepless rage over friendships, a colleague wrote aprogram that sorted all the data in each snippet, thereby ruining your dream of making billions inthe stock market. There is still hope! You plan on utilizing the partial information you gathered tohelp recover the original data collected by writing data recovery program. The data you had initially stored was the value of a stock on a particular day (at fixed intervals)and the absolute change in the stock value (between the fixed intervals). Luckily, your sortmethod only sorted the stock values with respect to each other and the changes with respect toeach other. You quickly realize that the number of valid data arrangements can be quite large. Forthis assignment your program should output only the number of possible data arrangements givethe unsorted list of values and the unsorted list of price differences. Suppose the values of a particular section were 1, 2, 3, 5, and 4. Then the absolute differenceswould be 1, 1, 2, and 1. The sorted values would become 1, 2, 3, 4, and 5. While the sortedabsolute differences would be 1, 1, 1, and 2. Input Specification The input will begin with an integer n (n ≤ 12), number data points for a given data set. The next line will each contain n space separated integers, ai (1 ≤ ai ≤ 10,000), representing the data points for the stock value on the given day. The next line contains n – 1 space separated integers, di (0 ≤ di ≤ 9,999), representing the absolute differences between stock values between the fixed intervals. Output Specification The program should output the number of valid distinct arrangements of ai values that complies with the input given.

Input Output Example

INPUT
5
1 2 3 4 5
1 1 1 2

OUTPUT :4

Values (2, 1, 3, 4, 5) => differences (1, 2, 1, 1) Values (4, 5, 3, 2, 1) => differences (1, 2, 1, 1) Values (5, 4, 3, 1, 2) => differences (1, 1, 2, 1) Note 1: Although the difference order is repeated the values are different between the first and fourth order and the second and third order. Note 2: that even though the first order is the reverse of the third order. The two orders are consider different. This is because the value of the stock is different at the different times.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
Answers: 1
question
Engineering, 04.07.2019 18:10
Water at 55c flows across a flat plate whose surface temperature is held constant at 95c. if the temperature gradient at the plate's surface for a given value of x is 18 c/mm, find a) local heat transfer coefficient. b) heat flux
Answers: 3
question
Engineering, 04.07.2019 18:10
Draw the engineering stress-strain curve for (a) bcc; (b) fcc metals and mark important points.
Answers: 1
You know the right answer?
You have worked hard to collect snippets of stock data for training an AI to predict markets forday...
Questions
question
English, 24.01.2022 22:51
question
Business, 24.01.2022 22:51
question
Mathematics, 24.01.2022 22:51
question
Mathematics, 24.01.2022 22:51
question
Mathematics, 24.01.2022 22:51
Questions on the website: 13722367