Questions tagged [boolean-expression]

A boolean expression is an expression in a programming language that produces a boolean value when evaluated, i.e. one of true or false.

In computer science, a Boolean expression is an expression in a programming language that produces a Boolean value when evaluated, i.e. one of true or false. A Boolean expression may be composed of a combination of the Boolean constants true or false, Boolean-typed variables, Boolean-valued operators, and Boolean-valued functions.

1049 questions
-2
votes
1 answer

Separating expression in chaining comparison operator python

Can anyone explain, What exactly the exp1 and exp2 are doing? Kindly separate each case so it can understandable. a, b, c, d, e, f = 0, 5, 12, 0, 15, 15 exp1 = a <= b < c > d is not e is f exp2 = a is d > f is not c print(exp1) print(exp2)
-2
votes
2 answers

finding a boolean circuit with AND, OR and NOT gates only

I am trying to find a Boolean circuit with AND, OR and NOT gates only to computes the Boolean function of ¬((A → ¬B) ∧ (C → A)). my attempt is : Where I put arrows on two of the joints (where i believe "→ or Implies" goes in the function) is what…
Kaka Pin
  • 81
  • 1
  • 9
-2
votes
1 answer

Boolean Algebra Unsure how to simplifiy an expression

I'm having a lot of trouble with two problems the first is: 1) (y*w) + y + w What I tried here is applying the distributive law as follows (y*w) + (y+w) ((y+w) + y) * ((y+w) + w) ((y*w) + y) * ((y*w) + w) then applying the absorption law and…
-2
votes
1 answer

how to parse an input string such as "4>1", resolve the expression and return boolean

I am learning Java now and don't know how to convert an input string(such as "4>1") to get a boolean return. The goal that I want to achieve is that, let Java return boolean(true/false) based on the user input, which is in String? For example, I…
Suye Shen
  • 11
  • 2
-2
votes
3 answers

Boolean operators and parentheses

Can someone explain to me why this is returning false? All of these statements should be true, except for the one with OR statements - so it should be fine, yet it returns false when I run it. c1 = 2; c2 = 2; row = 3; column = 2; if ((c2 < 3) &&…
-2
votes
1 answer

Can't make my do loop stop when it is done

I've written a script in vba which is scraping data from a certain site very smoothly. I was trying to do the same in an unconventional way. The loop I have used in my script is continuing on and on. I need to apply a logic here so that when the…
SIM
  • 21,997
  • 5
  • 37
  • 109
-2
votes
3 answers

Category isn't this unless property is false

As the title describes. I am stuck, an otherwise simple use of and, xor, or expressions in a LINQ statement. from s in db.Items where && s.Category.Contains("something") && s.IsReviewed == false Where I want…
CAD.Dev
  • 187
  • 1
  • 1
  • 12
-2
votes
1 answer

JAVA return value from constructor

public class RightAngleTriangle { int height; int width; double area; double perimeter; public RightAngleTriangle() { height = 1; width = 1; } public RightAngleTriangle(int hei, int wid) { …
sdfjbs
  • 23
  • 5
-2
votes
1 answer

How does this simplify? Explanation

AB(CD+D+C) AB(C+D(1+C) AB(C+D) I had this as an example and I didn't really understand what laws it used to get to this point. I know that using Nulls Law (OR) that 1+C = 1 so it leaves AB(C+D) but I didn't understand how AB(CD+D+C) becomes…
-2
votes
2 answers

OR gate using XOR gate & AND gate only.

A digital circuit supports two operations A ⊕ B and A . B [i.e. XOR , AND operations] Derive a Boolean Expression for A + B using the above two operations.
-2
votes
1 answer

Expression to be reduced by using Boolean algebra

Hi I have this expression XY'Z+YY'+X+XY'+XZ ( ' means not) Can anyone please show me the simplification of this expression? Thanks in advance. This is what i got so far: XY'Z+YY'+XY'+X(1+Z) XY'Z+YY'+XY'+XY'+X Y'(XZ+Y)+X(1+Y') Y'(XZ+Y)+X I know…
-2
votes
1 answer

public bool get set - exception for a page

I have the following code on a page: public bool HeaderVisible { get { return lnkHeader.Visible; } set { lnkHeader.Visible = value; } } Let's say a specific page I have, Events.aspx, I don't want the element with the ID…
user2600293
  • 21
  • 1
  • 8
-2
votes
1 answer

Show that ~(A XOR B) is the same as (~A XOR B) using Boolean algebra

I need to show that the expression: ~(A XOR B) is equivilant to (~A XOR B) using boolean algebra. I really have no idea how to start, any help would be appreciated.
user1795609
  • 147
  • 1
  • 2
  • 7
-3
votes
2 answers

Simplify Boolean expression with De Morgan's laws

I need to simplify this Boolean expression with De Morgan's laws. ¬c xor (¬b ∨ c) Could someone help me?
mik
  • 3
  • 2
-3
votes
4 answers

Is there a faster way of evaluating every combination of booleans in an if statement in python?

If I have 4 booleans e.g if ((a(x) == True) and (b(x) == True) and (c(x) == True) and (d(x) == True) then I want to do something different for each combination including when only 3 of them are true (including which ones), 2..., then only each 1...…