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 12:10
On a average work day more than work place firs are reorted
Answers: 1
question
Engineering, 04.07.2019 18:10
Fluids at rest possess no flow energy. a)- true b)- false
Answers: 3
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10Γ€1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
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
Chemistry, 26.11.2021 01:40
question
English, 26.11.2021 01:40
question
English, 26.11.2021 01:40