Ask Your Question

Minhminh's profile - activity

2019-11-17 20:56:56 -0600 received badge  Notable Question (source)
2019-11-17 20:56:56 -0600 received badge  Popular Question (source)
2015-12-19 12:14:34 -0600 asked a question How to declare variable for a function with other variable?
n=var("n")
def T(n):
    a=1
    b=x
    if n==0:
        return a
    if n==1:
        return b
    else:
        for i in [2..n]:
            b=2*x*b-a
            a=(a+b)/(2*x)
    return b

Could you help me to compute T(i) at x=1 or anything ?Mean that I want to declare x is a variable of T(i), but I can't. Thank you so much

2015-12-19 12:14:23 -0600 asked a question How to declare another variable for a polynomial

n=var('n") def T(n): a=1 b=x if n==0: return a if n==1: return b else: for i in [2..n]: b=2xb-a a=(a+b)/(2*x) return b Could you help me to compute T(i) at x=1 or anything ?Mean that I want to declare x is a variable of T(i), but I can't. Thank you so much