Ask Your Question

Revision history [back]

You can get the characteristic function of the solution set as follows:

sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))

and the plot it to see the solution set:

sage: plot(f,-10,10)

You can get the characteristic function of the solution set (which is a list of lists of symbolic elements) as follows:

sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))

and the plot it to see the solution set:

sage: plot(f,-10,10)

You can get the characteristic function of the solution set (which is a list of lists of symbolic elements) as follows:

sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))

and the then plot it to see the solution set:

sage: plot(f,-10,10)

You can get the characteristic function of the solution set (which is a list of lists of symbolic elements) as follows:

sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))

and then plot it to see the solution set:

sage: plot(f,-10,10)

or even:

sage: plot(f,-10,10, fill='axis')