def misidentification_genotype_dict(G, p):
    """
    same misidentification probabilities as misidentification(F,p)
    with prob p(1-p), AA -> aa, aa -> AA, Aa stays the same, B/b stay same
    with prob p(1-p), 
    """
    G_new = {}
    n = G.keys()[0]
    G_new.setdefault(n, {})
    for genotypes in G[n].keys():
        G_new[n].setdefault(genotypes, 0.0)
    for genotypes in G[n].keys():
        weight = G[n][genotypes]
        g1, g2, g3, g4, g5, g6, g7, g8 = genotypes
        g9 = n - g1 - g2 - g3 - g4 - g5 - g6 - g7 - g8
        G_new[n][g1, g2, g3, g4, g5, g6, g7, g8] += weight * (1 - 2 * p + p **
            2)
        G_new[n][g7, g8, g9, g4, g5, g6, g1, g2] += weight * p * (1 - p)
        G_new[n][g3, g2, g1, g6, g5, g4, g9, g8] += weight * p * (1 - p)
        G_new[n][g9, g8, g7, g6, g5, g4, g3, g2] += weight * p ** 2
    return G_new
