Proper rational check with symbols

6 views (last 30 days)
Hiralben Mistry
Hiralben Mistry on 2 Nov 2018
Answered: John D'Errico on 2 Nov 2018
How can I check whether a rational is proper or not? 'isproper' does not work when the expression has symbols too.

Answers (2)

madhan ravi
madhan ravi on 2 Nov 2018
syms x
assume(x,'real')
q= x/(x+1)
[n,d]=numden(q)
if subs(n,x,10)<subs(d,x,10) %substitute any number for symbolic variable to use logical condition
disp('proper fraction')
else
disp('not proper buddy')
end

John D'Errico
John D'Errico on 2 Nov 2018
Hard to say, because your question is not at all clear.
A proper fraction is one that is less than 1 in absolute value. Thus the numerator is less than the denominator in terms of absolute value.
But a symbolic parameter (until you resolve it into an actual number) has no value. That is, is the symbolic expression represented by y a proper fraction?
syms x
y = x - 1
You can't say a thing. The value of y depends completely upon x.
Of course, in some circumstances, you could prove that a number is less than 1.
y = 1/(x^2 + 1.5)
If x is ANY real number at all, then y is ALWAYS less than 1. But there is a caveat. What if x is complex? That is, suppose we could have x=sqrt(-1)? Then clearly, x is not a proper fraction, because y would be 2 in that case.
In general, if an expression has symbols in it, so there are parameters in the expression which are not resolved into a numeric value, then there will be regions where the expression represents a proper fraction, or not. If you have multiple unknown parameters, then those domains may be quite complex, or there may be infinitely many such domains. For example, suppose you have the expression
y = sin(x) + 0.5
There are infinitely many subdomains where y is a proper fraction.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!