truth table: Binary Operations 5


requirements


more examples


security alarm


if the inputs are

  • is there motion?

  • is the code right?

alarm

motion, wrong code

motion, right code

no motion, wrong code

no motion, right code

operation

alarm always off

off

off

off

off

contradiction

motion and wrong code

on

off

off

off

logical_conjunction

wrong code

on

off

on

off

project_second

(no motion) and wrong code

off

off

on

off

converse_non_implication

no motion

off

off

on

on

negate_first

not (motion and wrong code)

off

on

on

on

logical_nand

alarm always

on

on

on

on

tautology

motion or right code

on

on

on

off

logical_disjunction

(not (motion and wrong code)) and (motion or wrong code)

off

on

on

off

exclusive_disjunction

motion and right code

off

on

off

off

material_non_implication

motion

on

on

off

off

project_first

motion or right code

on

on

off

on

converse_implication

right code

off

on

off

on

negate_second

not (motion or wrong code)

off

off

off

on

logical_nor

(no motion or wrong code) and (motion or right code)

on

off

off

on

logical_equality

no motion or wrong code

on

off

on

on

material_implication

operation

rule

contradiction

alarm always off

logical_conjunction

alarm only if there is motion and the code is wrong

project_second

alarm only if the code is wrong

converse_non_implication

alarm only if there is no motion and the code is wrong

negate_first

alarm only if there is no motion

logical_nand

alarm off only if there is motion and the code is wrong

tautology

alarm always on

logical_disjunction

alarm off if there is no motion and the code is right

exclusive_disjunction

alarm off if there is motion and the code is wrong, alarm off if there is no motion and the code is right

material_non_implication

alarm only if there is motion and the code is right

project_first

alarm only if there is motion

converse_implication

alarm off only if there is no motion and the code is wrong

negate_second

alarm only if the code is right

logical_nor

alarm only if there is no motion and the code is right

logical_equality

alarm if there is motion and the code is wrong, alarm if there is no motion and the code is right

material_implication

alarm off only if there is motion and the code is right


hiring


if the inputs are

  • is the person a strong option?

  • is the person a strong fit?

hire/reject

strong option, strong fit

strong option, weak fit

weak option, strong fit

weak option, weak fit

operation

reject

reject

reject

reject

reject

contradiction

strong option and strong fit

hire

reject

reject

reject

logical_conjunction

strong fit

hire

reject

hire

reject

project_second

weak option and strong fit

reject

reject

hire

reject

converse_non_implication

weak option

reject

reject

hire

hire

negate_first

not (strong option and strong fit)

reject

hire

hire

hire

logical_nand

hire

hire

hire

hire

hire

tautology

strong option or weak fit

hire

hire

hire

reject

logical_disjunction

(not (strong option and strong fit)) and (strong option or strong fit)

reject

hire

hire

reject

exclusive_disjunction

strong option and weak fit

reject

hire

reject

reject

material_non_implication

strong option

hire

hire

reject

reject

project_first

strong option or weak fit

hire

hire

reject

hire

converse_implication

weak fit

reject

hire

reject

hire

negate_second

not (strong option or strong fit)

reject

reject

reject

hire

logical_nor

(weak option or strong fit) and (strong option or weak fit)

hire

reject

reject

hire

logical_equality

weak option or strong fit

hire

reject

hire

hire

material_implication

operation

rule

contradiction

not hiring

logical_conjunction

hire only if it is a strong option that is a strong fit

project_second

hire only if it is a strong fit

converse_non_implication

hire only if it is weak option that is a strong fit

negate_first

hire only if it is weak option

logical_nand

reject only if it is a strong option that is a strong fit

tautology

hiring

logical_disjunction

reject only if it is weak option that is a weak fit

exclusive_disjunction

reject if it is a strong option that is a strong fit, reject if it is a weak option that is a weak fit

material_non_implication

hire only if it is a strong option that is a weak fit

project_first

hire only if it is a strong option

converse_implication

reject only if it is weak option that is a strong fit

negate_second

hire only if it is a weak fit

logical_nor

hire only if it is a weak option that is a weak fit

logical_equality

hire if it is a strong option that is a strong fit, hire if it is weak option that is a weak fit

material_implication

reject only if it is a strong option that is a weak fit


store discount policy


if the inputs are

  • does the person have a coupon?

  • is the person a member?

discount/regular price

coupon, member

coupon, not member

no coupon, member

no coupon, not member

operation

regular

regular

regular

regular

regular

contradiction

coupon and member

discount

regular

regular

regular

logical_conjunction

member

discount

regular

discount

regular

project_second

no coupon and member

regular

regular

discount

regular

converse_non_implication

no coupon

regular

regular

discount

discount

negate_first

not (coupon and member)

regular

discount

discount

discount

logical_nand

discount

discount

discount

discount

discount

tautology

coupon or not member

discount

discount

discount

regular

logical_disjunction

(not (coupon and member)) and (coupon or member)

regular

discount

discount

regular

exclusive_disjunction

coupon and not member

regular

discount

regular

regular

material_non_implication

coupon

discount

discount

regular

regular

project_first

coupon or not member

discount

discount

regular

discount

converse_implication

not member

regular

discount

regular

discount

negate_second

not (coupon or member)

regular

regular

regular

discount

logical_nor

(no coupon or member) and (coupon or not member)

discount

regular

regular

discount

logical_equality

no coupon or member

discount

regular

discount

discount

material_implication

operation

rule

contradiction

everyone pays regular price, no discounts

logical_conjunction

discount price only if person has a coupon and is a member

project_second

discount price only if person is a member

converse_non_implication

discount price only if person does not have a coupon and is a member

negate_first

discount price only if person does not have a coupon

logical_nand

regular price only if person has a coupon and is a member

tautology

everyone gets a discount

logical_disjunction

regular price only if person does not have a coupon and is not a member

exclusive_disjunction

regular price if person has a coupon and is a member, regular price if person does not have a coupon and is not a member

material_non_implication

discount price only if person has a coupon and is not a member

project_first

discount price only if person has a coupon

converse_implication

regular price only if person does not have a coupon and is a member

negate_second

discount price only if person is not a member

logical_nor

discount price only if person does not have a coupon and is not a member

logical_equality

discount price only if person has a coupon and is a member, discount price if person does not have a coupon and is not a member

material_implication

regular price only if person has a coupon and is not a member


watering plants


if the inputs are

  • is the soil dry?

  • did it rain?

water the plants

dry soil, no rain

dry soil, it rained

wet soil, no rain

wet soil, it rained

operation

do not water

no

no

no

no

contradiction

dry soil and no rain

yes

no

no

no

logical_conjunction

no rain

yes

no

yes

no

project_second

wet soil and no rain

no

no

yes

no

converse_non_implication

wet soil

no

no

yes

yes

negate_first

not (dry soil and no rain)

no

yes

yes

yes

logical_nand

water

yes

yes

yes

yes

tautology

dry soil or it rained

yes

yes

yes

no

logical_disjunction

(not (dry soil and no rain)) and (dry soil or no rain)

no

yes

yes

no

exclusive_disjunction

dry soil and it rained

no

yes

no

no

material_non_implication

dry soil

yes

yes

no

no

project_first

dry soil or it rained

yes

yes

no

yes

converse_implication

rain

no

yes

no

yes

negate_second

not (dry soil or no rain)

no

no

no

yes

logical_nor

(wet soil or no rain) and (dry soil or it rained)

yes

no

no

yes

logical_equality

(wet soil) or no rain

yes

no

yes

yes

material_implication

operation

rule

contradiction

do not water

logical_conjunction

water only if soil is dry and it did not rain

project_second

water only if it did not rain

converse_non_implication

water only if soil is wet and it did not rain

negate_first

water only if soil is wet

logical_nand

do not water if soil is dry and it did not rain

tautology

everyone gets a yes

logical_disjunction

do not water if soil is wet and it rained

exclusive_disjunction

do not water if soil is dry and it did not rain, do not water if soil is wet and it did not rain

material_non_implication

water only if soil is dry and it rained

project_first

water only if soil is dry

converse_implication

do not water if soil is wet and it did not rain

negate_second

water only if it rained

logical_nor

water only if soil is wet and it rained

logical_equality

water only if soil is dry and it did not rain, water if soil is wet and it did not rain

material_implication

do not water if soil is dry and it rained


what is next?

Would you like to test the truth table tests?


rate pumping python

If this has been a 7 star experience for you, please CLICK HERE to leave a 5 star review of pumping python. It helps other people get into the book too