About Fuzzy LogicDate: 05/06/2003 at 13:42:59 From: Aasim Subject: Fuzzy logic What is fuzzy logic? What's the difference between fuzzy logic and Boolean logic? What are connectives in fuzzy logic? Date: 05/06/2003 at 15:49:59 From: Doctor Achilles Subject: Re: Fuzzy logic Hi Aasim, Thanks for writing to Dr. Math. Boolean or "two-valued" logic is traditional logic with all statements either being true or false. I'm going to assume that you are comfortable with the basics of traditional logic. If you want a review of some concepts, you can find it at: A Crash Course in Symbolic Logic http://mathforum.org/dr.math/faq/symbolic_logic.html Fuzzy or "multi-valued" logic is a variation of traditional logic in which there are many (sometimes infinitely many) possible truth values for a statement. True is considered equal to a truth value of 1, false is a truth value of 0, and the real numbers between 1 and 0 are intermediate values. You can find the basics of fuzzy logic at: What is Fuzzy Logic? http://mathforum.org/library/drmath/view/55625.html As far as the more advanced question of connectives in fuzzy logic, here are what I believe are the generally accepted rules. You start with the basic connectives is symbolic logic: ^ (and) v (or) -> (if, then) <-> (if and only if) ~ (not) And extend them. Let's start with ^ (and). In Boolean logic (A ^ B) is true if and only if both A is true and B is true. We can say that in a different way: (A ^ B) has a value of 1 if A has a value of 1 and B has a value of 1, if either A or B has a value of 0, then the conjunction has a value of 0. So the way this is traditionally extended to fuzzy logic is to say that the conjunction (A ^ B) carries the minimum truth value of A or B. For example, if A has a truth value of 1 and B has a truth value of 0.8, then the minimum of these two is 0.8 and the conjunction (A ^ B) will carry the truth value of 0.8. Next, let's talk about v (or). In Boolean logic (A v B) is true if A is true or if B is true or if both are true. We can say that in a different way: (A v B) has a value of 1 if A has a value of 1 or B has a value of 1, if both A and B have a value of 0, then the disjunction has a value of 0. So the way this is traditionally extended to fuzzy logic is to say that the disjunction (A v B) carries the maximum truth value of A or B. For example, if A has a truth value of 0.2 and B has a truth value of 0.6, then the maximum of these is 0.6 and the disjunction (A v B) will carry the truth value of 0.6. Next, let's talk about ~ (not). Unlike the other connectives, ~ doesn't join two sentences; it is only applied to a single sentence. In Boolean logic, ~A carries the opposite truth value of A. So it is false if A is true and true if A is false. Or: ~A has a value of 0 if A has a value of 1 and a value of 1 if A has a value of 0. The way this is extended to fuzzy logic is to say that ~A has a truth value equal to 1 minus the truth value of A. So, for example, if A has a value of 0.3, then 1 - 0.3 = 0.7, so ~A has a value of 0.7. Next, let's talk about -> (if, then). In Boolean logic, (A -> B) is ONLY false if A is true AND B is false; in all other cases it is true. Or, (A -> B) carries a value of 1 UNLESS A has a value of 1 and B has a value of 0. So, if A has a value of 0, then (A -> B) will definitely have a value of 1; or if B has a value of 1 then (A -> B) will definitely have a value of 1. So (A -> B) is at least as true as the opposite of A, and it is also at least as true as B. So in Boolean logic, (A -> B) has a truth value equal to the maximum of ~A and B. Fuzzy logic uses this definition. The truth value of (A -> B) is equal to the maximum of the truth value of ~A and the truth value of B. For example, if B has a truth value of 0.5 and A has a truth value of 0.4, then ~A has a value of 0.6. The maximum of B (0.5) and ~A (0.6) is 0.6 so (A -> B) will have a value of 0.6. The last connective, <-> (if and only if), is the hardest to extend to fuzzy logic. In Boolean logic, (A <-> B) is true if both A and B have the same truth value, and false otherwise. Or you can say: (A <-> B) has a value of 1 if A and B both have a value of 1 or if A and B both have a value of 0, and it has a value of 0 otherwise (i.e. if A has a value of 0 and B has 1 or vice versa). My first guess for how to apply this to fuzzy logic was that it is simply an equals relation. So if A and B have equal values, then (A <-> B) will have a value of 1; otherwise it will have a value of 0. This is okay as a first guess, but the problem is that now (A <-> B) can only have 1 or 0 as a value, which is not really very fuzzy at all. Let's go back to Boolean logic for a minute and think a bit more about (A <-> B). This is read "A if and only if B." It means that if we know A is true, then we can conclude that B is true AND we if we know B is true, then we can conclude that A is true. In other words, (A <-> B) is equivalent to the conjunction of (A -> B) and (B -> A) or to put it more formally: (A <-> B) = ((A -> B) ^ (B -> A)) But we've already figured out how to do fuzzy logic on these connectives. So let's just apply that to our <-> connective. Specifically: (A <-> B) has a value equal to the minimum (conjunction) of: (A -> B) and (B -> A) So first you figure out the value of (A -> B) (which is the maximum of ~A and B), then you figure out the value of (B -> A) (which is the maximum of ~B and A), and then you take the minimum of those. That's pretty complicated, so before we do an example calculation with fuzzy logic, let's make sure it works with two-valued (Boolean) logic. Let's say that A and B both have truth values of 0. What does (A <-> B) have in this case? First, we take the maximum of ~A and B. ~A will have a value of 1 and B will have a value of 0. So the maximum is 1. Second, we take the maximum of ~B and A. ~B will have a value of 1 and A will have a value of 0. So the maximum is 1. Finally, we take the minimum of the first two steps above. Step one gave us 1 and step two gave us 1, so the minimum is 1. What if A has a truth value of 1 and B has a truth value of 0? First, we take the maximum of ~A and B. ~A will have a value of 0 and B will have a value of 0. So the maximum is 0. Second, we take the maximum of ~B and A. ~B will have a value of 1 and A will have a value of 1. So the maximum is 1. Finally, we take the minimum of the first two steps above. Step one gave us 0 and step two gave us 1, so the minimum is 0. For a fuzzy logic example, let's say that A has a value of 0.7 and B has a value of 0.5. What is the value of (A <-> B)? First, we take the maximum of ~A and B. ~A will have a value of 0.3 and B will have a value of 0.5. So the maximum is 0.5. Second, we take the maximum of ~B and A. ~B will have a value of 0.5 and A will have a value of 0.7. So the maximum is 0.7. Finally, we take the minimum of the first two steps above. Step one gave us 0.5 and step two gave us 0.7, so the minimum is 0.5. So in this example (A <-> B) has a truth value of 0.5. Fuzzy logic can get very complicated, and I went very quickly over some tough concepts. Please let me know if there is anything else you'd like to talk about or if there are any steps I took too quickly here. - Doctor Achilles, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2015 The Math Forum
http://mathforum.org/dr.math/