Questions tagged [truthtable]

A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, boolean functions, and propositional calculus—to compute the functional values of logical expressions on each of their functional arguments, that is, on each combination of values taken by their logical variables.

In particular, truth tables can be used to tell whether a propositional expression is true for all legitimate input values, that is, logically valid.

Practically, a truth table is composed of one column for each input variable (for example, A and B), and one final column for all of the possible results of the logical operation that the table is meant to represent (for example, A XOR B). Each row of the truth table therefore contains one possible configuration of the input variables (for instance, A=true B=false), and the result of the operation for those values.

210 questions
0
votes
0 answers

How can I create a truth table generator with a random number of variables extracting the arguments of recursive functions?

I tried to build a truth table generator for practice. Here is what I wrote: from itertools import product, tee def variables_truth(num=2): #Return a list of True and False according to the num of Variables #Such as (T,T,F,F)(T,F,T,F)…
Paolo
  • 43
  • 4
0
votes
1 answer

Trying to simplify Karnaugh Map with only four groups of "True" Indicators

In the included screenshot, I am trying to derive the simplest boolean function. I used these four groups of ones to derive the different variable groups. According to the solution in my book, I don't have the correct four groups, but it does seem…
0
votes
0 answers

List all possible truth value combinations VBA

I am trying to write a VBA script that will list all the possible combinations of truth values for a truth table in an excel spreadsheet. I am taking a philosophy class and I thought it would be fun to write a code to first list all combinations of…
user13770287
0
votes
1 answer

When two variables is logically compared, the logic gate that tests the equivalence is? Using logic gate

When two variables is logically compared, the logic gate that tests the equivalence .. If XOR please explain Why ? if XNOR Please explain Why?
0
votes
1 answer

How can I find the equation from this truth-table using k-map or QM method?

How can I find the equation from this truth table using k-map or QM method?
0
votes
3 answers

Express a truth table using a single if-condition

My code looks like this: /* * A B * 0 0 -> 1 * 0 1 -> 0 * 1 0 -> 0 * 1 1 -> 0 */ #define A condition_1 #define B condition_2 if (A) { // do nothing } else { if (B) { // do nothing } else { // do something …
TonyRomero
  • 182
  • 1
  • 4
  • 14
0
votes
1 answer

Truth Table. Printing the sum of each True value for each row in the desired format

I'm able to sum up the value of each True statement per row, but I can't get it to print in a column format next to the result. `res = eval(exp) # evaluate the logical input from the user print(res) # this prints the result of the logical…
0
votes
0 answers

Equivalent boolean expressions with truth table in Java

I want to verify, that one boolean expression is mathematically equivalent to another. Let's say, we have 3 boolean variables: a, b, c. The expression X = ((a || b) && !c). Then I rewrite some code, and it turns out, that Y = !(((!a && !b) || c) &&…
0
votes
0 answers

Convert truth table into PHP code when some inputs may be missing

I have two arrays $a and $b, the first being the data used to populate a form, the other being the output of the form, which may have been changed by the user. We cannot assume that all inputs are present in both arrays. I want a new array which…
magnol
  • 344
  • 3
  • 15
0
votes
1 answer

Best data set for truth table to compute and reduce Sum of Products in C#

so im trying to create a truth table in C# so that i can preform some boolean algebra on it. it is suppose to be a three variable truth table with 8 rows. so far right now im trying to use a string array of an array to input the truth…
Ventus
  • 81
  • 6
0
votes
1 answer

how to convert these 7-segment decoder to boolean expression

how to convert these 7-segment decoder to boolean expression?? BCD 7-Segment decoder A B C D a b c d e f g 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 …
0
votes
1 answer

Simplify boolean equation from truth table

I need help simplifying the following to the simplest terms. Boolean algebra just doesn't quite click with me yet, any help is appreciated. (!A!B!C)+(!AB!C)+(!ABC)+(A!B!C)+(A!BC)+(AB!C) I got it to the following, but I don't know where to go from…
0
votes
2 answers

Truth table using recursion

i am trying to create a truth table in c# for 3 symbols so it should produce 2^3 = 8 tables. but my recursive method is not working. My code is below. in each loop i add a symbol and make new dictionary with one true and one false value. public…
Aseem Malhotra
  • 75
  • 1
  • 2
  • 9
0
votes
1 answer

Dividing by zero without ArithmeticException

When trying to write a truthtable I tried to figure out the algorithm, and I found one that works. However now I don't understand why it doesn't throw a ArithmeticException. for(int i=0; i
SVJ
  • 1
0
votes
1 answer

Logical equivalence

I have a question about the use of formal language. Could someone please explain me why this statement is logically equivalent? f ∨ g ∧ h ≡ (f ∨ g) ∧ (f ∨ h). I made two truth tables (see the pictures below), but this statement doesn´t hold (it…
KM1234
  • 33
  • 2