Question

You are given a boolean expression consisting of a string of the symbols 'true', 'false', and', 'or', and 'xor'.


[III.4] You are given a boolean expression consisting of a string of the symbols 'true', 'false', and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, there is only 1 way to parenthesize 'true and false xor true' such that it evaluates to true. Complete the following tasks.  

[III.4a] Show the parenthesization of the example such that evaluate to true.   'true and false xor true' 

[III.4b] Show the optimal substructure of the problem (describe in your own words or derive an equation.)   Then recursively define the optimal solution.  

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per HOMEWORKLIB POLICY, I will answer III.4 and III.4a

ANSWER TO III.4

As you can see, out of 16 possibilities, 8 will result in a true expression.

ANSWER TO III.4a

The answer to this would be (true and false) xor true

Steps to evaluate the above:

1) true and false will give false

2) false xor true gives true.

Add a comment
Know the answer?
Add Answer to:
You are given a boolean expression consisting of a string of the symbols 'true', 'false', and', 'or', and 'xor'.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Code to be written in C++: Initially, you will be given symbols printed in a preorder...

    Code to be written in C++: Initially, you will be given symbols printed in a preorder traversal of a boolean expression tree. The internal nodes of the tree will contain one of the following operators: & (and), | (or), ^ (exclusive-or), or ! (not). The nodes containing the first three operators will have two children, while the nodes containing the ! operator will contain only a left child. The leaves of the tree will contain an operand - either f...

  • Im try to create a java program that checks to see if a given boolean expression...

    Im try to create a java program that checks to see if a given boolean expression is a tautology or not my code so far is as follows: public static class TreeNode    {        char data;        TreeNode left;        TreeNode right;               TreeNode(char item)        {            data = item;            left = null;            right = null;        }    } public static...

  • Derive the Boolean expression of a combination logic from the following truth table, where A, B,...

    Derive the Boolean expression of a combination logic from the following truth table, where A, B, C are input variables and D is output. Draw the circuit diagram to implement it. Show your working steps. The full subtractor is a combinational circuit, which is used to perform subtraction of three input bits: the minuend X, subtrahend Y, and borrow in B_in. The full subtractor generates two outputs bits: the difference D and borrow out B_out. B_in is set when the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT