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
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
question
Engineering, 04.07.2019 18:10
Different types of steels contain different elements that alter the characteristics of the steel. for each of the following elements, explain what the element does when alloyed with steel.
Answers: 2
question
Engineering, 04.07.2019 18:10
The thermal expansion or contraction of a given metal is a function of the f a)-density b)-initial temperature c)- temperature difference d)- linear coefficient of thermal expansion e)- final temperature f)- original length
Answers: 2
question
Engineering, 06.07.2019 03:10
An electrical kettle is made out of stainless steel,weighs two pounds (when empty) with a heating element that consumes 2 kw of electricity. assuming that the water and the kettle are at the same uniform temperature at any moment of time, calculate the shortest possible time to bring 2 quarts of water from room temperature to the onset of boiling.
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
Mathematics, 10.02.2020 22:28
question
Mathematics, 10.02.2020 22:28
Questions on the website: 13722363