clear all; close all;

tickers = ["USD", "EUR", "GBP", "CAD", "JPY", "CNY", "RUB", "MXN", "INR", "BRL"];
n = length(tickers);
% USD
F = [1.0, 0.87, 0.76, 1.31, 108.90, 6.72, 65.45, 19.11, 71.13, 3.69;
% EUR
0.0, 1.0, 0.88, 1.51, 125.15, 7.72, 75.23, 21.96, 81.85, 4.24;
% GBP
0.0, 0.0, 1.0, 1.72, 142.94, 8.82, 85.90, 25.08, 93.50, 4.84;
% CAD
0.0, 0.0, 0.0, 1.0, 82.93, 5.11, 49.82, 14.54, 54.23, 2.81;
% JPY
0.0, 0.0, 0.0, 0.0, 1.0, 0.062, 0.60, 0.18, 0.65, 0.034;
% CNY
0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 9.74, 2.85, 10.61, 0.55;
% RUB
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.29, 1.09, 0.056;
% MXN
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 3.73, 0.19;
% INR
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.052;
% BRL
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0];
for j = 1:n
    for i = j+1:n
        F(i,j) = 1.035/F(j,i);
    end
end
% Initial and final portfolios.
c_req = 1:n;
c_req = 1e4*c_req.'/sum(c_req);
c_init = c_req(10:-1:1);