import numpy as np
import matplotlib.pyplot as plt
# bit indices
bits = np.arange(8)
# values for each bit in a binary system
bit_values_bin = 1 << bits
# all possible combinations of bits on/off
bit_combos = (np.arange(256)[:, np.newaxis] & bit_values_bin) >> bits
# all possible values in a binary system
possible_values = np.sort(np.dot(bit_combos, bit_values_bin))
plt.plot(possible_values)
# all values with modified weights
bit_values_new = bit_values_bin ** 2
possible_values = np.sort(np.dot(bit_combos, bit_values_new))
plt.plot(possible_values)
bit_values_new = bit_values_bin ** 0.5
possible_values = np.sort(np.dot(bit_combos, bit_values_new))
plt.plot(possible_values)
bit_values_new = np.log(bit_values_bin)
possible_values = np.sort(np.dot(bit_combos, bit_values_new))
plt.plot(possible_values)