Browse Definitions :
Definition

Boolean

What is Boolean?

In computing, the term Boolean means a result that can only have one of two possible values: true or false. Boolean logic takes two statements or expressions and applies a logical operator to generate a Boolean value that can be either true or false. To return the result, operators like AND, OR, NOT, etc. are used.

Boolean search uses Boolean logic to connect keywords or phrases in a query. A user may use this query to find specific information in a database or during a web search. The Boolean search query combines the search terms into a machine-readable format.

Boolean logic vs. fuzzy logic
Whereas fuzzy logic is an approach to computing based on 'degrees of truth,' modern computing is based on Boolean logic, which is based on the usual 'true or false' (1 or 0) dichotomy.

Boolean logic refers to a system of logical thought developed by George Boole (1815-1864) in 1854. He was an English mathematician and philosopher as well as one of the pioneers of mathematical logic that set the stage for modern computing. His goal was to combine certain concepts and exclude certain other concepts when searching databases for information.

However, it was only in 1951 that the logic system was commercialized. This happened when Bell Labs used Boolean logic as a part of AN/FSQ-7, a massive computer used by the U.S. Air Force.

Boolean logic drives modern digital devices, such as computers and smartphones. It is used to describe electromagnetically-charged memory locations or circuit states in a computer that are either charged (1 or true) or not charged (0 or false). The computer can use logic gates and Boolean operators to obtain a result that can be used for further processing.

Common Boolean operators and web searches

Boolean logic is based on several operators known as logical operators or simply Boolean operators. These operators work on a Boolean expression or conditional statement consisting of two words or other values. The Boolean operation then generates a Boolean value that expresses a "truth value."

Boolean operators are used in computer programming, mathematical formulas and algorithms. They are often used to refine web searches. Using a Boolean operator as a conjunction between two keywords in a web search either combines or excludes them, thus generating more focused and useful results.

The three most used Boolean operators are the following:

  • AND.
    • AND's purpose is to narrow the search.
    • The AND operator considers both terms in the logical operation or search which means that both terms should appear in each item returned by the search. If one term is in the searched material but the other is not, the item will not be included in the result.
    • Example: If a user searches for "pear AND apple," the system will assume that the user is looking for results containing both words and not just one of them.
  • OR.
    • OR's purpose is to broaden the search.
    • The OR operator considers either term in the operation or search. If either term is contained in the material that is being searched, it will be included in the search results.
    • Example: If the search term is "pear OR apple," the system will search for and display results that contain either pear or apple.
  • NOT or AND NOT.
    • NOT and AND NOT's purposes are to exclude specific terms from the search.
    • This operator will result in the first term being searched. Any records containing the term after the operator will not appear in the results.
    • Example: A search for "Guatemala NOT Guatemala City" will include results only for Guatemala and will not return items containing Guatemala City.
types of algorithms
Computer programming, mathematical formulas and algorithms use Boolean operators.

Other Boolean operators

In addition to AND, OR and NOT, several other Boolean operators are also frequently used:

  • NOR. NOR finds a result whose value is true only if both terms are false.
  • NAND. NAND generates a false result if both inputs are true. Otherwise, the output is true.
  • XOR. XOR acts as a logical either/or, so the output is true if either -- but not both -- of the inputs is true.

Boolean data type

The term Boolean is sometimes presented with a lower case "b": boolean. Strictly speaking, Boolean with an uppercase "B" refers to Boolean logic or Boolean algebra, while boolean refers to a data type in computer programming. The other two major data types are text and numbers.

Boolean algebra is a subset of mathematics concerned with operations on logical values, including binary variables. It underpins logical processing and decision-making in programming.

The Boolean data type values may be the following:

  • True or false
  • Yes or no
  • On or off value
  • 1 or 0

These values create conditions and determine how a program behaves in response to a certain event (e.g., if "X condition" is true, then do "Y").

Example 1: If a user types the correct password, then allow them to log in.

If a user types the correct password, the Boolean data type would be "true." It indicates that the object is valid or "true," which would allow the user to log in.

Example 2: If a user does not click on CAPTCHA, then display an error message.

If the user forgets to click on the CAPTCHA after typing in their email address and password, the object would be invalid. So the Boolean value would be "false."

captcha examples
The Boolean value would be 'false' if a user forgets to click on a CAPTCHA after typing in their email address and password, as the object would be invalid.

Boolean logic in programming

In many programming languages, Boolean operators are used with conditional statements. For example, in Perl, they can be used with if statements:

if (($name eq "Gale") && ($password eq "iloveyou")) {

 print "Success\n";

}

else {

 print "Fail\n";

 die;

}

Here, the && (AND) operator will look for username "Gale" and password "iloveyou." If both values are correct, it will print "Success." If either value is incorrect, it will print "Fail."

Similarly, in JavaScript, Boolean conditionals are used in if statements and for loops.

if (boolean conditional) {

 console.log("boolean conditional resolved to true");

} else {

 console.log("boolean conditional resolved to false");

See also: fuzzy logic, proximity operator, search string, logical negation symbol, character, Karnaugh map, Claude Shannon, truth table, logical implication and mathematical symbols

This was last updated in November 2022

Continue Reading About Boolean

Networking
  • subnet (subnetwork)

    A subnet, or subnetwork, is a segmented piece of a larger network. More specifically, subnets are a logical partition of an IP ...

  • secure access service edge (SASE)

    Secure access service edge (SASE), pronounced sassy, is a cloud architecture model that bundles together network and cloud-native...

  • Transmission Control Protocol (TCP)

    Transmission Control Protocol (TCP) is a standard protocol on the internet that ensures the reliable transmission of data between...

Security
  • cyber attack

    A cyber attack is any malicious attempt to gain unauthorized access to a computer, computing system or computer network with the ...

  • digital signature

    A digital signature is a mathematical technique used to validate the authenticity and integrity of a digital document, message or...

  • What is security information and event management (SIEM)?

    Security information and event management (SIEM) is an approach to security management that combines security information ...

CIO
  • product development (new product development)

    Product development -- also called new product management -- is a series of steps that includes the conceptualization, design, ...

  • innovation culture

    Innovation culture is the work environment that leaders cultivate to nurture unorthodox thinking and its application.

  • technology addiction

    Technology addiction is an impulse control disorder that involves the obsessive use of mobile devices, the internet or video ...

HRSoftware
  • organizational network analysis (ONA)

    Organizational network analysis (ONA) is a quantitative method for modeling and analyzing how communications, information, ...

  • HireVue

    HireVue is an enterprise video interviewing technology provider of a platform that lets recruiters and hiring managers screen ...

  • Human Resource Certification Institute (HRCI)

    Human Resource Certification Institute (HRCI) is a U.S.-based credentialing organization offering certifications to HR ...

Customer Experience
  • contact center agent (call center agent)

    A contact center agent is a person who handles incoming or outgoing customer communications for an organization.

  • contact center management

    Contact center management is the process of overseeing contact center operations with the goal of providing an outstanding ...

  • digital marketing

    Digital marketing is the promotion and marketing of goods and services to consumers through digital channels and electronic ...

Close