Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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))

click to hide/show revision 2
None

updated 2 years ago

Max Alekseyev gravatar image

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)=xx; w(x,n)=x(w(x,n1))

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))
click to hide/show revision 3
None

updated 2 years ago

Max Alekseyev gravatar image

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)=xx; $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))