fable/data/logic/boolean_algebra.json
2025-04-17 15:53:45 -06:00

161 lines
6.3 KiB
JSON

{
"unit": {
"Logic": "BooleanAlgebra"
},
"title": "Mastering Boolean Algebra",
"screens": [
{
"screen_type": "Text",
"text": "Welcome, Cadet! You've been selected to join the Galactic Programming Fleet's advanced training program. Your mission: master the principles of Boolean algebra to solve complex logical problems and optimize your code. Ready to elevate your skills? Let's begin!",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Text",
"text": "Boolean algebra is a branch of algebra that deals with true and false values. It provides a framework for simplifying logical expressions and is widely used in programming, circuit design, and more.",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Text",
"text": "In Boolean algebra, we use operations like AND, OR, and NOT, but we also work with laws and properties such as the commutative, associative, distributive, identity, and complement laws. These help us simplify and analyze logical expressions.",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Text",
"text": "For example, the commutative law states that the order of operands does not matter for AND and OR operations. A AND B is the same as B AND A, and A OR B is the same as B OR A.",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Mcq",
"text": "",
"question": "Which of the following is true according to the commutative law?",
"options": [
"A AND B is the same as B AND A.",
"A OR B is the same as B OR A.",
"Both of the above."
],
"correct_indices": [2],
"correct_text": null,
"hints": [
"The commutative law applies to both AND and OR operations."
]
},
{
"screen_type": "Text",
"text": "The associative law states that the grouping of operands does not affect the result for AND and OR operations. For example, (A AND B) AND C is the same as A AND (B AND C).",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Mcq",
"text": "",
"question": "Which of the following expressions is equivalent to (A OR B) OR C according to the associative law?",
"options": [
"A OR (B OR C)",
"(A AND B) OR C",
"A AND (B AND C)"
],
"correct_indices": [0],
"correct_text": null,
"hints": [
"The associative law applies to OR operations."
]
},
{
"screen_type": "Text",
"text": "The distributive law allows us to distribute AND over OR and vice versa. For example, A AND (B OR C) is equivalent to (A AND B) OR (A AND C).",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Checkboxes",
"text": "",
"question": "Which of the following are valid applications of the distributive law? Select all that apply.",
"options": [
"A AND (B OR C) = (A AND B) OR (A AND C)",
"A OR (B AND C) = (A OR B) AND (A OR C)",
"A AND (B AND C) = (A AND B) AND C"
],
"correct_indices": [0, 1],
"correct_text": null,
"hints": [
"The distributive law applies to both AND over OR and OR over AND."
]
},
{
"screen_type": "Text",
"text": "The identity law states that A AND true is A, and A OR false is A. These identities help simplify expressions by removing redundant terms.",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "FreeResponse",
"text": "",
"question": "What does A OR false simplify to according to the identity law?",
"options": null,
"correct_indices": null,
"correct_text": ["A", "a"],
"hints": [
"The identity law states that A OR false is A."
]
},
{
"screen_type": "Text",
"text": "The complement law states that A AND NOT A is false, and A OR NOT A is true. These laws are fundamental in Boolean algebra.",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
},
{
"screen_type": "Mcq",
"text": "",
"question": "What does A AND NOT A evaluate to according to the complement law?",
"options": [
"True",
"False",
"A"
],
"correct_indices": [1],
"correct_text": null,
"hints": [
"The complement law states that A AND NOT A is always false."
]
},
{
"screen_type": "Text",
"text": "Congratulations, Cadet! You've completed the course on Boolean algebra. Remember, mastering these principles will help you simplify logical expressions and write efficient code. Keep practicing and applying these concepts in your projects!",
"question": null,
"options": null,
"correct_indices": null,
"correct_text": null,
"hints": null
}
]
}