Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004
R.<A,B,C>=QQ[] slimme_formule=[(A^5, 5*A^4*B + 10*A^3*B^2 + 10*A^2*B^3 + 5*A*B^4 + B^5, C^5), (A^5, B^5, A^4*C - A^3*B*C + A^2*B^2*C - A*B^3*C + B^4*C), (A^4 + 6*A^3*B + 12*A^2*B^2 + 8*A*B^3, 2*A*B^3 + 3*B^4, A*C^3 + 3*B*C^3), (-A^4 + 2*A^2*C^2, 4*A^2*B^2 + 4*A*B^3 + B^4, C^4), (A^4 + 4*A^3*B + 6*A^2*B^2, 4*A*B^3 + B^4, C^4), (A^4, 4*A*B^3 + 3*B^4, A^2*C^2 - 2*A*B*C^2 + 3*B^2*C^2), (A^4, A^3*C - A^2*B*C + A*B^2*C - B^3*C, B^4), (A^4, 2*A^3*B + A^2*B^2 + 2*A*B*C^2 + B^2*C^2, C^4), (A^4, 2*A^2*C^2 - C^4, 4*A^2*B^2 + 4*A*B^3 + B^4), (-A^4 + 2*A^3*B, 2*A*B^3 - B^4, A^3*C - 3*A^2*B*C + 3*A*B^2*C - B^3*C), (A^2*B^2 + 2*A*B^3 + A^2*C^2 + 2*A*B*C^2, B^4, C^4), (A^4 + 4*A^3*B + 4*A^2*B^2, -2*B^2*C^2 + C^4, B^4), (A^3, 9*A^2*B + 6*A*B^2 + B^3, 4*A*C^2 + B*C^2), (A^3 + 3*A^2*B + 3*A*B^2, B^3, C^3), (A^3, A*C^2 - 2*B*C^2, 3*A*B^2 + 2*B^3), (A^3, 3*A^2*B + 3*A*B^2 + B^3, C^3), (A^3, B^3, A^2*C - A*B*C + B^2*C), (A^3 + 6*A^2*B + 9*A*B^2, B^3, A*C^2 + 4*B*C^2), (A^3 + 3*A^2*B, 3*A*B^2 + B^3, C^3), (2*A^3 + 3*A^2*B, 2*A*C^2 - B*C^2, B^3), (A^2, 2*A*B + B^2, C^2), (A^2, A*C - B*C, B^2), (A^2 + 2*A*B, B^2, C^2)]
R.<A,B,C>=QQ[] def minimaal(expr): uit=1 for w in (expr.subs(C=A+B)).factor(): mogelijk=[w[0],w[0].subs(A=C-B),w[0].subs(B=C-A)] keuze=map(lambda x: len(x.dict()),mogelijk) uit=uit*mogelijk[keuze.index(min(keuze))]^w[1] return uit minimaal((A+B)^6*(2*A+B)^2*A^3*B^4).factor()
(2*A + B)^2 * A^3 * B^4 * C^6
def vulin(exp1,exp2): R.<D,E,F>=QQ[] return tuple(map(lambda x: minimaal(x.subs(A=D,B=E,C=F).subs(D=exp2[0],E=exp2[1],F=exp2[2])),exp1)) R.<A,B,C>=QQ[] exp1=(A^2, -A*C + B*C, B^2) exp2=(A*B + A*C, B^2, C^2) vulin(exp1,exp2)
(A^4 + 4*A^3*B + 4*A^2*B^2, -2*B^2*C^2 + C^4, B^4)
def succes(ABC_trio): slim=False faktoren=list(prod(ABC_trio).subs(C=A+B).factor()) tel_fact=sum([w[1] for w in faktoren if w[0] not in [A,B,A+B]])-1 if tel_fact==-1: tel_fact=1 tel_ABC=sum([w[1] for w in faktoren if w[0] in [A,B,A+B]]) test=tel_fact+2*tel_ABC-(7/2)*(max(map(lambda x:x.degree(),ABC_trio))-1) if test>6: slim=True return slim print succes((A^4, A^3*B + 2*A^3*C + 3*B^3*C + 3*A*B*C^2 - 2*A*C^3, 3*A*B^3 + 3*B^4 - 3*A^2*B*C - B*C^3 + C^4)) print succes((A,B,C))
True True
R.<A,B,C>=QQ[] aantal=5 groot_slim=[] for exp1 in slimme_formule[:aantal]: for exp2 in slimme_formule[:aantal]: exp12=vulin(exp1,exp2) for exp3 in slimme_formule[:aantal]: nwerelatie=vulin(exp12,exp3) if succes(nwerelatie): gevonden=tuple(map(lambda x: slimme_formule.index(x),[exp1,exp2,exp3])) print gevonden, groot_slim.append(gevonden)
(0, 0, 0) (1, 1, 1)
groot_slim
[(0, 0, 0), (1, 1, 1)]