Question

In: Computer Science

You have a super-nature talent in stock prediction. You want to prove your talent to the...

You have a super-nature talent in stock prediction. You want to prove your talent to the entire world. You have predicted the next 10 days’ stock values. Each day after the market is closed, you plan to reveal that day’s prediction, so others can verify whether your prediction is correct or not. Obviously, you need to convince others that you know that day’s stock value beforehand. You don’t want to reveal your prediction before the market is closed, because you don’t want others to benefit from your predictions. At the beginning, you can publish some numbers in a popular newspaper, but you can only afford to publish 64 characters (the size of one hash value) in the newspaper. You reveal your prediction everyday and at the end of 10 days people can authenticate the 10 predications you have revealed over the last 10 days. Given these restrictions, describe the way you will design a system to prove your predictions.

Solutions

Expert Solution

The maximum characters/day without using the division logic is 64/10 = 6.4, which is pretty straightforward and not something we are looking for. So, how can we optimize?

We can use the concept of a Difference Array(because the difference in stock values on the next few days is close) as follows:

1. For the first day, we publish the predicted value as it is.

2. For the following days, we publish the difference between the predicted values of the previous day and current day.

For example, Say we need to publish values - 1000 , 1200 , 2500 , 4000 , 3600 , 900.

Then, we publish the following :-

100020013001500-400-2700

** Making it bold would help differentiate between the values.

What this means is take the first character, that's the first day's value. Add 200 to it to get the next day's value = 1200. Add 1300 to previous sum(i.e 1200) to we get 2500. Adding 1500 to 2500, we get 4000. Now, add -400 to 4000 to get 3600 and finally add -2700 to get 900.

This is pretty easy to decode and understand. To optimize this further, you can change the base of numbers to Hexadecimal or something else, if you want to save space but I'll omit this given the context that layman isn't good with hexadecimal calculation.


Related Solutions

Suppose you have $400 in cash in your margin account. You want to buy a stock...
Suppose you have $400 in cash in your margin account. You want to buy a stock with 50% margin allowed by your broker and you decide you use full margin. Price of the stock is $10 per share. If stock price falls to $9, what is your margin % after the price fall?
You have $100,000 and want to invest in stock market. Explain the composition of your potential...
You have $100,000 and want to invest in stock market. Explain the composition of your potential portfolio.
You have a viral stock of an unknown concentration and you want to determine the titer...
You have a viral stock of an unknown concentration and you want to determine the titer of the virus by plaque assay. Your lab mate has VERO cells growing in the lab and you decide to use them for a plaque assay. After infection with a range of dilutions, none of the plates showed plaques. Give 2 possible reasons why you did not get any plaques. You repeat the plaque assay using CHO as the target cells this time. You...
Nature of risk is “inability to predict accurately”. How you will prove this definition in context...
Nature of risk is “inability to predict accurately”. How you will prove this definition in context of COVID19? Define nature of risk. How can risk be evaluated on the economic scale?
Question:1(a) Nature and nurture in your life. In what ways have nature and nurture impacted your...
Question:1(a) Nature and nurture in your life. In what ways have nature and nurture impacted your development? Do you possess any attributes that seem to be more clearly influenced by one factor over the other? Is there any way to tease apart what has resulted from nature and what has resulted in nurture in your own development? Question: 1(b)Albert Einstein wrote, “Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will...
Assume you have a limited stock of copper in a mine of 30 units. You want...
Assume you have a limited stock of copper in a mine of 30 units. You want to know how many units to extract this year (Q1) and how many to extract next year (Q2). The slope of the marginal benefit curve is: MB: y = -0.4Q + 12 and the slope of the marginal cost curve is: MC: y = 4 Use the formula PV(MB1 - MC1) = PV(MB2 - MC2) to calculate how many units of copper to extract...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first task assigned by the Senior Project Manager is to select and prioritise the best mobile application project in response to COVID-19 and the second task assigned is to write the Project Scope of the chosen project. These candidate projects include: Gaming or entertainment application for COVID-19 isolated patients.  Mobile applications in support of contact tracing for COVID-19.  Mobile application information to provide...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first task assigned by the Senior Project Manager is to select and prioritise the best mobile application project in response to COVID-19 and the second task assigned is to write the Project Scope of the chosen project. These candidate projects include:  Gaming or entertainment application for COVID-19 isolated patients.  Mobile applications in support of contact tracing for COVID-19.  Mobile application information to...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first...
You have been accepted as a Junior Project Manager at Super IT Pty. Ltd. Your first task assigned by the Senior Project Manager is to select and prioritise the best mobile application project in response to COVID-19 and the second task assigned is to write the Project Scope of the chosen project. These candidate projects include:  Gaming or entertainment application for COVID-19 isolated patients.  Mobile applications in support of contact tracing for COVID-19.  Mobile application information to...
The Super Bowl Indicator Theory suggests that the stock market will have a positive year if...
The Super Bowl Indicator Theory suggests that the stock market will have a positive year if the team in the National Football Conference, or a team with an NFC origin, wins. If the American Football Conference team wins, the market will fall. According to the recent news (MarketWatch, 2/6/2017), it has accurately predicted the direction of the market for the year following 40 of the 50 Super Bowls since the first super bowl in 1967. Why do we have such...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT