[SOLVED] Arbitrage

20.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 U.S. dollar buys 0.7 British pound, 1 British pound buys 9.5 French francs, and 1 French franc buys 0.16 U.S. dollar.

Then by converting currencies, a trader can start with 1 U.S. dollar and buy 0.7 × 9.5 × 0.16 = 1.064 U.S. dollars, thus turning a profit of 6.4 percent. Suppose that we are given n currencies. Give an efficient algorithm to determine whether or not there exists a sequence of currencies.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.