<｜begin▁of▁sentence｜>### Instruction:
Given a discrete distribution [0.1, 0.35, 0.15, 0.4], how do you calculate the normalized cumulative distribution?
### Response:
import numpy as np
import networkx as nx

# Example data: a discrete distribution
values = np.array([0.1, 0.35, 0.15, 0.4])

# Function to compute the cumulative distribution
def cumulative_distribution(values):
    cdf = np.cumsum(values) / np.sum(values)
    return cdf

# Calculate and print the cumulative distribution
result = cumulative_distribution(values)
print('Cumulative Distribution:', result)
<|EOT|>
