This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ranked by discretionary assets managed in hedge funds worldwide, in millions, as of June 30, 2018, unless otherwise noted. | |
Rank Manager Assets Change from 2017 | |
1 Bridgewater Associates $132,756 7.9% | |
2 AQR Capital Mgmt. $83,700 9.2% | |
3 Man Group $59,100 11.3% | |
4 Renaissance Technologies $57,000 17.3% | |
5 Two Sigma Inv./Two Sigma Advisers $38,800 9.6% | |
6 Millennium Mgmt. $35,314 2.7% | |
7 Elliott Management $35,000 7.0% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pypfopt.black_litterman import BlackLittermanModel | |
from pypfopt.efficient_frontier import EfficientFrontier | |
from pypfopt import plotting | |
from openbb_terminal.sdk import openbb | |
import seaborn as sns | |
sns.set_theme() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from operator import itemgetter | |
from time import time | |
from binance.client import Client | |
FEE = 0.0005 | |
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB'] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def second_largest(n): | |
first = n[0] | |
second = n[1] | |
if second > first: | |
first, second = second, first | |
for i in range(2, len(n)): | |
if n[i] > first: | |
first, second = n[i], first | |
if second > first: | |
first, second = second, first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def monty_hall(): | |
doors = np.array([1, 0, 0]) | |
np.random.shuffle(doors) | |
initial_choice = np.random.randint(len(doors)) | |
goat_door = 0 | |
for i in range(len(doors)): | |
if i == initial_choice: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib_dp(n, memo): | |
if n in memo: | |
return memo[n] | |
else: | |
fib_n = fib_dp(n-1, memo) + fib_dp(n-2, memo) | |
memo[n] = fib_n | |
return fib_n | |
def fibonacci_dp(n): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_poisoned_bottle(bottles): | |
""" | |
Find position of the poisonous wine bottle in 1000 bottles, using 10 strips, given that there | |
is only 1 poisonous bottle of the 1000 bottles. | |
The logic is to line up all 10 strips and represent them as binary numbers, with each strip in a position for the | |
binary numbers. Then, each wine bottle is labeled from 1-1000. Since 2^10 is the first power of 2 that is greater than 1000, | |
10 strips are sufficient and we only need to test once with all 10 strips, and then wait 1 week for the test results to come back. | |
Then, aligning the strips in the same order as before, there will be a sequence of positive and negative strips. Converting that | |
sequence from binary (with positive as 1's and negative as 0's) back into decimal form, we will have the index of the poisoned |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import math | |
from matplotlib import pyplot as plt | |
def pi_monte_carlo(num_simulations, radius=1): | |
return ... | |
if __name__ == "__main__": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def selection_sort(a): | |
for i in range(len(a)): | |
curr_min = i | |
for j in range(i, len(a)): | |
if a[j] < a[curr_min]: | |
curr_min = j | |
if curr_min != i: | |
a[i], a[curr_min] = a[curr_min], a[i] |
NewerOlder