Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are two investment machines. If you put $X in one machine, there is 60% of chance it will return $2*X (and 40% returning $0);

  1. There are two investment machines. If you put $X in one machine, there is 60% of chance it will return $2*X (and 40% returning $0); if you put $X in the other machine, there is 40% of chance it will return $2*X (and 60% returning $0). You just dont know which machine is which! You have a total of $100 to start with, and you can only invest a maximum of 30 times. The minimum amount to invest is $0 with $1 minimum incremental.

  2. Use Python to implement the following vanilla investment strategy:

    1. Put $1 in each investment machine for 10 times to see which one returns more money (thus, you

      have invested a total of 20 times). Break tie whatever way you prefer.

    2. For the remaining money, always invest half (of the current remaining total money) in the more

      profitable machine discovered each time, for the last 10 times of investment.

Simulate this strategy for 1000 times. Print out the average amount of return, the standard deviation, and the Sharpe Ratio you end up with using this strategy.

The standard deviation measures how spread out a set of numbers is. (see sample code below to learn how to calculate std with the python numpy module). The Sharpe Ratio is a way to evaluate the performance of investment by adjusting for its risk. The ultimate goal of the investment is to maximize the Sharpe Ratio, defined as follows:

(average gain) / (standard deviation + 1), where average gain = average return - risk free amount (in this case: the risk free amount = $100). That is, we seek for a higher return, with relatively low volatility. To avoid the rare situation where the standard deviation is 0, we add 1 in the demometer.

--> Then design and implement a better investment strategy (with a larger Sharpe Ratio) than the vanilla one above.

Useful background info: In artificial intelligence (AI), the first step in the vanilla approach above is often called exploration which uses trial-and-error to see which option is best. The second step is often called exploitation which exploits the newly learned best option to make a maximum profit. Exploration and exploitation can be interleaved and integrated in sophisticated and intelligent ways to achieve an optimal outcome.

In real-world, things are often much more complicated. For example, there are usually more investments to choose from, each with an unknown distribution of returns which may vary over time, and so on. This type of problems in this assignment do have widespread important applications. The investments can be the restaurants you are exploring and enjoying in a new city, different subjects you try to choose in universities, or different jobs/career you want to work for in your life. The assignment may also be helpful to improve your rational decision-making under uncertainty.

You must define and use the following functions in your final submission:

  1. Define and use the main function

  2. Define and use a function for repeated investment of a fixed amount in one machine. The function should take three arguments: the machine number, the money you invest each time, and total times you invest with the fixed amount. You will see the benefit of defining such a function, which is an abstraction for repeated calculations.

  3. Define and use a function for repeated investment of a fixed percentage of the current total money you have in one machine. The function should take three arguments: the machine number, the percentage you invest each time, and total times you invest with the fixed percentage.

  4. You can define any other functions if needed. (Please show me answer in python language:) )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions