Question

In: Computer Science

Overview and objective: Basic logic In this homework, you will exercise your understanding of boolean logic...

Overview and objective: Basic logic

In this homework, you will exercise your understanding of boolean logic and the gates and circuits that embody it. A thorough understanding of boolean logic is extremely useful for almost all programming tasks and necessary to correctly implement complex systems. Additionally, greater familiarity with boolean logic should improve one’s ability to think critically in general as it forms the basis for all human reasoning.

Technical Description and Instructions:

1. Consider the logical expression ( !x && y) && ! (x && !y). Make a truth table for this expression.

2. Construct a truth table for the expression (!x && y). Is the output column of the truth table the same as the previous expression’s truth table? What does this mean?

3. Simplify the following expressions using the boolean algebra properties with which you are familiar. Name the properties that you use to simplify them.

a) (x && y) && (x &&!y)

b) !x || (!y || x)

c) T || ( !y || x )

d) T && (( !y || x) || x )

Solutions

Expert Solution

1. ( !x && y) && ! (x && !y)

Truth Table : ( !x && y) && ! (x && !y)

x y !x !y (!x && y) (x && !y) ! (x && !y) ( !x && y) && ! (x && !y)
0 0 1 1 0 0 1 0
0 1 1 0 1 0 1 1
1 0 0 1 0 1 0 0
1 1 0 0 0 0 1 0

2. (!x && y)

Truth table : (!x && y)

x y !x (!x && y)
0 0 1 0
0 1 1 1
1 0 0 0
1 1 0 0

The expressions ( !x && y) && ! (x && !y) and  (!x && y) are equivalent expressions i.e the expression ( !x && y) && ! (x && !y) can be simplified and reduced to (!x && y).

3.

(a) (x && y) && (x &&!y)

= x && y && x && !y (Using Associative law)

= x && (y && !y) (since x && x = x)

= x && False (Since y && !y = False, If y = 1 then !y = 0 , so 1 && 0 = 0)

= False (Since the output of AND operation is False is one of the inputs are False)

(b) !x || (!y || x)

= !x || !y || x (Using Associative law)

= True || !y (Since x || !x = True)

= True (Since output of OR operation is True is one of the inputs are True)

(c) T || ( !y || x )

= T || !y || x (Using Associative law)

= T (Since output of OR operation is True if one of the inputs are True)

= True

(d) T && (( !y || x) || x )

= (T && (!y || x)) || (T && x) (Using Distributive Law)

=( (T && !y) || (T && x) ) || (T && x) (Using Distributive Law)

= (!y || x ) || (x) (If one of the inputs of AND operation is True, then the output depends on the value of other inputs)

= !y || x || x (Using Associative Law)

= !y || x (Since x OR x = x)


Related Solutions

Objective: In this assignment you will apply your knowledge and understanding of the AD/AS model to...
Objective: In this assignment you will apply your knowledge and understanding of the AD/AS model to a hypothetical scenario. Instruction: Write a response to the following scenario on a word file or equivalent and submit it as an 'upload file'. Please note you can only submit the following file types, doc, docx, pdf, txt, png, and jpeg. Graphs can be hand-drawn or computer graphics. Remember to correctly label all your graphs! For example, what the x and y axis represent....
Objective: In this assignment, you will apply your knowledge and understanding of poverty and income inequality...
Objective: In this assignment, you will apply your knowledge and understanding of poverty and income inequality to real world issues. I nstruction: Watch and read the following materials before you write your response: The Costs of Inequality - Joseph Stiglitz (Links to an external site.) Three main philosophies of redistribution of income: Utilitarianism: the government should chose policies that maximize the total utility of everyone in society. For example, giving $100 to a homeless person would have a bigger impact...
we are going to focus on basic logic and how you can use logic outside of...
we are going to focus on basic logic and how you can use logic outside of the classroom. Unfortunately, many of our daily interactions include logical errors. Respond to the following prompts in a minimum of 175 words: Consider a recent interaction you have had with a co-worker or item that you saw in the media that might have included logical errors. Share the example as well as the logical errors that are present in the example. Be sure to...
The objective of this homework is to give you experience using inheritance with C++. You will...
The objective of this homework is to give you experience using inheritance with C++. You will use the provided employee base class and implement two derived classes, salaried employee and hourly employee. For this assignment, you will use the base class Employee, which is implemented with the files Employee.h and Employee.cpp. A test file, test.cpp, is also provided for your use, as you choose to use it. Each employee object has a user id; a first and last name; a...
Consider the following definitions given to you for Boolean logic: not = λx.((x false) true) true...
Consider the following definitions given to you for Boolean logic: not = λx.((x false) true) true = λx.λy.x false = λx.λy.y Show that not (not true) evaluates to true. Your steps must use proper substitutions and each step must be accompanied with a brief explanation (e.g., "replacing the bound x with false", etc.). You can use "L" for the lambda symbol in your answer.
----- Please solve the questions with the code below. Thank you. ----- Exercise Overview Refactor your...
----- Please solve the questions with the code below. Thank you. ----- Exercise Overview Refactor your code to enhance the user experience and to use objects and classes. All functional requirements in Project 1 remain, except where enhancing the system replaces specific functions. Functional Requirements The console entry point for the user inputs is on the same line as the prompt. (new) User enters name at the beginning of a session. System covers four math operations – addition, subtraction, multiplication,...
Question Objective: The objective of this lab exercise is to give you practice in programming with...
Question Objective: The objective of this lab exercise is to give you practice in programming with one of Python’s most widely used “container” data types -- the List (commonly called an “Array” in most other programming languages). More specifically you will demonstrate how to: Declare list objects Access a list for storing (i.e., writing) into a cell (a.k.a., element or component) and retrieving (i.e., reading) a value from a list cell/element/component Iterate through a list looking for specific values using...
Use your understanding of game theory and the Prisoner's Dilemma to explain the logic of multilateral...
Use your understanding of game theory and the Prisoner's Dilemma to explain the logic of multilateral trade agreements
IN BASIC C# If It Fits, It Ships! OVERVIEW In this program you will be calculating...
IN BASIC C# If It Fits, It Ships! OVERVIEW In this program you will be calculating the total amount the user will owe to ship a rectangular package based on the dimensions and we will add in insurance based on the prices of the items inside of the package.. INSTRUCTIONS: 1. Welcome the user and explain the purpose of the program. 2. In the Main, prompt the user for the width, length and height of their package. a. Each of...
please give a brief overview of your understanding of the following: foundational documents and principles of...
please give a brief overview of your understanding of the following: foundational documents and principles of research ethics, sensitive research questions, confidentiality, and community-based research ethics. 2. What is the IRB? 3. Explain what is mean by exempted research? What are conflicts of interest (COI)?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT