Engineering
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.

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 12:10, Ryantimes2
On a average work day more than work place firs are reorted
Answers: 1
image
Engineering, 04.07.2019 18:10, selenamr
Ifa component is made of two or more materials with different modulus of elasticity (e), it is called a composite member and we calculate the factorΒ·n". mention the formula for calculating n". also, ifn> 1, explain what will happen to the 1. transformed. gi) ifn 1, what will happen to the material when transformed material when
Answers: 1
image
Engineering, 04.07.2019 18:20, miguel454545
Along 8-cm diameter steam pipe whose external surface temperature is 900c connects two buildings. the pipe is exposed to ambient air at 70c with a wind speed of 50 km/hr blowing across the pipe. determine the heat loss from the pipe per unit length. (b) air at 500c enters a section of a rectangular duct (15 cm x 20 cm) at an average velocity of 7 m/s. if the walls of the duct are maintained at 100c. a) the length of the tube for an exit temperature of the air to be 40 0c. b)the rate of heat transfer from the air. c) the fan power needed to overcome the pressure drop in this section of the duct.
Answers: 1
image
Engineering, 04.07.2019 18:20, annette211pdd8v9
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
Do you know the correct answer?
You have worked hard to collect snippets of stock data for training an AI to predict markets forday...

Questions in other subjects:

Konu
Mathematics, 31.08.2020 01:01
Konu
Mathematics, 31.08.2020 01:01