Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does implication operation reflect for?

Tags:

c#

.net

c#-4.0

I want to know what does implication operation reflect for?

The truth table for the implication operator: enter image description here

using System;
class Implication
{
    static void Main()
    {
        bool p = false, q = false;
        int i, j;
        for (i = 0; i < 2; i++)
        {
            for (j = 0; j < 2; j++)
            {
                if (i == 0) p = true;
                if (i == 1) p = false;
                if (j == 0) q = true;
                if (j == 1) q = false;
                Console.WriteLine("p is " + p + ", q is " + q);
                if (!p | q) Console.WriteLine(p + " implies " + q +
                 " is " + true);
                Console.WriteLine();
            }
        }
    }
}

I mean why we use Implicatin Operation?

like image 921
Masoud Darvishian Avatar asked Mar 16 '26 01:03

Masoud Darvishian


1 Answers

"p implies q" means "if p is true, then q must also be true":

p       q       p implies q
false   false   true
false   true    true
true    false   false
true    true    true

You can check that !p | q has the same truth table.

like image 108
Henrik Avatar answered Mar 18 '26 15:03

Henrik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!