Ask Your Question

Revision history [back]

defining a recursive function

I need to define the function w(x,n). x is real (0<x&lt;1), n="" is="" an="" integer.="" (w(x,1)="x^x;" w(x,n)="x^(w(x,n-1))&lt;/p">

I tried the following, the function definition didn't send an error message but the plot call did and failed: def w(x,n): if n==1: return x^x else: return x^(w(x,n-1))

plot (w(x,n), (x, 0.01, 0.99) (n, 1, 10))

defining a recursive function

I need to define the function w(x,n). x $w(x,n)$. $x$ is real (0<x&lt;1), n="" is="" an="" integer.="" (w(x,1)="x^x;" w(x,n)="x^(w(x,n-1))&lt;/p"> ($0 < x < 1$), N is an integer. $w(x,1) = x^x$; $w(x,n) = x^(w(x,n-1))$

I tried the following, the function definition didn't send an error message but the plot call did and failed: failed:

def w(x,n):
    if n==1:
        return x^x
    else: 
        return x^(w(x,n-1))

x^(w(x,n-1))

plot (w(x,n), (x, 0.01, 0.99) (n, 1, 10))

10))

defining a recursive function

I need to define the function $w(x,n)$. $x$ is real ($0 < x < 1$), N is an integer. $w(x,1) = x^x$; $w(x,n) = x^(w(x,n-1))$x^{w(x,n-1)}$

I tried the following, the function definition didn't send an error message but the plot call did and failed:

def w(x,n):
    if n==1:
        return x^x
    else: 
        return x^(w(x,n-1))

plot (w(x,n), (x, 0.01, 0.99) (n, 1, 10))