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
1 answer

Understanding pseudo code and trace table

Can somebody please help me understand the following piece of pseudo code: int x=2, y=3, z=4 DO x *= 3 If (x>50) Then y -- Else z ++ End If WHILE(y>0) In particular, I'm not sure what 'z++' , '*=' and 'y--' means. Also, how…
0
votes
1 answer

Boolean implies another

Is there a programming language in which we can write something like: a => b to compute implication? (where a and b are booleans) The closest I can find is in Scala: a <= b But it looks completely different from the actual meaning of…
Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101
0
votes
2 answers

Truth tables issue

When I check my input from a text box, I pass it into a loop to check individual characters. I'm a little uncertain as to why this is happening, but when I input a "/", the function reads it as false? // Checks the Password contains the correct…
Ben
  • 2,433
  • 5
  • 39
  • 69
0
votes
2 answers

Dynamic Creation of JTable (Boolean Truth Tables)

I have a code that generates a truth table for a given Boolean Expression. For example, consider a user-input expression of (A+B)+(C+D). I have a string array headers[] that will store all necessary headers for the truth table. In this case, it…
0
votes
1 answer

Formula for generating truth table decimals

Given n variables I want to create decimals which equal all the possible binary variations in a truth table. e.g. For a,b and c let: a = 11110000 (240) b = 11001100 (204) c = 10101010 (170) For p and q let: p - 1100 (12) q - 1010 (10) I have…
George Reith
  • 13,132
  • 18
  • 79
  • 148
0
votes
2 answers

Generating Binary Inputs in C

Essentially, I have a program that has eight variables. I'm attempting to check every combination of truth values for these eight variables, and so I need a truth table using 0s and 1s that demonstrate every combination of them. These inputs will be…
Noc
  • 519
  • 7
  • 18
0
votes
1 answer

quasi truth tablet function

I'm trying to get the values of a table given the row, column, and the number size of each column variable. For example: getValue(row = 5, column = 1, column_variable_sizes = [3,2]) would return 1 this is the table the function is "generating" to…
waspinator
  • 6,464
  • 11
  • 52
  • 78
0
votes
0 answers

Generating Input Binary Combination Dynamically

I am currently working on a application where there is a requirement to generate binary combination of input signals in a truth table. The signal can be either '0' , '1' or 'X' (don't care). The requirement is to generate the input combination…
Dinesh
  • 311
  • 2
  • 12
0
votes
2 answers

Check the symmetry of a grid/truth table

t t f f f f t t t t f f f f t t f f t t t t f f f f t t t t f f t t f f f f t t t t f f f f t t f f t t t t f f f f t t t t f f Is it possible to determine the symmetry of the above 8x8 using 8-input truth tables e.g. OR, AND, XOR, etc?
Kevin
  • 41
  • 4
0
votes
3 answers

Truth Table for an expression( as string )

I want to compute the truth table for an expression(valid logical expression) input by the user as a String. Can anybody post an existing solution to this or guide me in doing so?? I am thinking of using a BitArray (of size 2^no. variables) as the…
Dynamite
  • 341
  • 2
  • 5
  • 17
-1
votes
1 answer

Generate all possible combinations basing on binary string and under some conditions

I have to write algorithm that will generate all possible combinations of different binary strings but under some conditions. The combinations are created by: Replacing binary "1" with "00" Other conditions: Input binary string, if contains 0, they…
Szyszka947
  • 473
  • 2
  • 5
  • 21
-1
votes
1 answer

Truth table for a pseudocode

I am looking at the truth table for following pseudocode. IF year = 11 AND (grade < target OR target >7) THEN SET revision_class TO true END IF I want to know whether the below truth table is correct or not. If it is correct, please explain me…
Norvin
  • 21
  • 4
-1
votes
4 answers

A standard/popular class to easily manage truth tables in C++?

Given a truth table with 5 inputs and one output, with a function prototype like: bool compute(bool in1, bool in2, bool in3, bool in4, bool in5); Is there somewhere, in the STL or other library, a class that allows to easily and efficiently manage…
Welgriv
  • 714
  • 9
  • 24
-1
votes
2 answers

How to fix output of truth table in C?

I'm trying to create a truth table in c, I have the left side built so i was able to show all the possibilities of the input numbers in a truth table. but i am having trouble getting the right output for the right side of the truth table. What I…
ally
  • 1
  • 1
-1
votes
2 answers

Am trying to read this csv file but I keep getting a range out of index, any ideas on how to avoid it?

Am trying to read this csv file that I will later choose the distinct elements in it and create a truth table if each element exists in a row I put 1 If not 0 The line/row length keeps isn't constant and that's what am having trouble…
Atraxia
  • 33
  • 7