import random


def generate_random_sequence(length, prob_dist=[0.25, 0.25, 0.25, 0.25]):
	""" generates a DNA sequence given length  according to the given nucleotide distribution """
	seq = ''
	for p in range(length):
		n = random.random()
		if n < prob_dist[0]: seq += 'A'
		elif n < sum(prob_dist[0:2]): seq += 'C'
		elif n < sum(prob_dist[0:3]): seq += 'G'
		else: seq += 'T' 
	return seq