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
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:10
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
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, 02.10.2019 03:40
Questions on the website: 13722360