retagged by
507 views
14 votes
14 votes

Many programming languages support a ternary conditional operator. For example, in $\text{C, C++},$ and $\text{Java}$, the expression $x ? y : z$ means “evaluate the boolean expression $x.$ If it's true, the entire expression evaluates to $y.$ If it's false, the entire expression evaluates to $z.$”

In the context of propositional logic, we can introduce a new ternary connective $?:$ such that $p ? q: r$ means “if $p$ is true, the connective evaluates to the truth value of $q,$ and otherwise it evaluates to the truth value of $r$.”

Let $p,q,r$ be three propositional variables. Which of the following is/are correct?

  1. Probability of $p ? q : r,$ being true is $\dfrac{1}{2}.$
  2. $p ? p : p$ is tautology.
  3. $p ? p : (\neg p)$ is tautology.
  4. $(\neg p) ? p : (\neg p)$ is tautology.
retagged by

2 Answers

Best answer
4 votes
4 votes

p:q?r $\equiv$ If p then q  and if not p then r $\equiv$ $(p\rightarrow q)\wedge (\neg p\rightarrow r)$

A) Probability of expression, p:q?r to be true = $\frac{I}{J}$ = $\frac{4}{8}$ = $\frac{1}{2}$
I = Total no. of rows in the truth table where given expression is true = #Models
J = Total no. of rows in the truth table = #Interpretaions

B) $(p\rightarrow p)\wedge (\neg p\rightarrow p) \equiv p$ (Contingency)

C) $(p\rightarrow p)\wedge (\neg p\rightarrow \neg p) \equiv True$ (Tautology)

D) $(\neg p\rightarrow p)\wedge (p\rightarrow \neg p) \equiv False$ (Contradiction)

Correct Option: A, C

 

selected by
3 votes
3 votes
  1. p?p:p

           There are two mutually exclusive cases here. We can translate as follows

           =  $(p\Lambda p )V({p}'\Lambda p)$

            P can take two values true and false. So, probability of p = probability of $p{}'$ = ½. 

            So, total probability is $\left ( \left ( 1/2 * 1/2 \right ) \right ) + \left ( \left ( 1/2 * 1/2 \right ) \right )$

            = 1/2

 

  1. p?p:p

           = $\left ( p \Lambda p\right ) V \left ( p{}' \Lambda p \right )$

           = $pVF = p$ ( not a tautology )

  1. p?p:$p{}'$

    = $\left (p  \Lambda p \right ) V \left ( p{}' \Lambda p{}'\right ) = p V p{}' = T$ ( tautology )
  1. $p{}' ? p:p{}'

    = \left ( p{}' \Lambda p \right ) V \left ( p \Lambda p{}' \right )

    = F V F = F$ ( not a tautology )

    So, correct options are A , C
Answer:

Related questions

6 votes
6 votes
1 answer
4