Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can someone solve this in C? the @ is actually 0 and there is between -b and c. Write a function function createTable (t, n),
can someone solve this in C?
the @ is actually 0 and there is between -b and c.
Write a function function createTable (t, n), which returns a table for a Boolean formula t with n inputs, which for each u jodor Input contains the output of the formular in the program code, the function t takes an array of Boolean values of the lengths as a parameter opposite. For example, the Boolean formula becomes a V (1-b) c) as a TScript function on function f(x) return x[@] or ((not x[1]) and x[2]); [2]); expressed The truth table should be returned as a nested n-dimensional array. Each individual array has two indexes, with index o being for bei Index o for false and index 1 stands for true. The corresponding value of the formula is stored in the innermost attay. The above.example becomes the following is wird das folgende three-dimensional array with a total of 8 values expected as return (line breaks and comments only to clarity the logiclichung der Logik) [false, true}, [false, false] #false or ((not false) and false) = false se # false or ((not false) and true) = trueue #false or ((not true) and false) = falsele # false or ((not true) and true) = false [true, true}, (true, true) #true or ((not false) and false) = trueue #true or ((not false) and true) = true true #true or ((not true) and false) = truee) = true #true or ((not true) and true) = truere true For any values a, b, c (0,1) it should have the property that the call of the formula Formel For any values a, b, c (0,1) it should have the property that the call of the formula Formul f((a == 1, b == 1, C == 1)) gives the same result aslo createTable(1, 3)[0][b][clic Hintsise . You can use the last property to check the correctness of your solution. Your solution should work for any no, not just for n-3 variables. Variablen, A recursive approach may be used to build the nested arrays. Note that the input to function is an array of Boolean values, not an array of values and 1. Accordingly, your und false im zurckgegebenen Array enthalten, so wie es im Beispiel der Fall ist itsprechend soil ihre Write a function function createTable (t, n), which returns a table for a Boolean formula t with n inputs, which for each u jodor Input contains the output of the formular in the program code, the function t takes an array of Boolean values of the lengths as a parameter opposite. For example, the Boolean formula becomes a V (1-b) c) as a TScript function on function f(x) return x[@] or ((not x[1]) and x[2]); [2]); expressed The truth table should be returned as a nested n-dimensional array. Each individual array has two indexes, with index o being for bei Index o for false and index 1 stands for true. The corresponding value of the formula is stored in the innermost attay. The above.example becomes the following is wird das folgende three-dimensional array with a total of 8 values expected as return (line breaks and comments only to clarity the logiclichung der Logik) [false, true}, [false, false] #false or ((not false) and false) = false se # false or ((not false) and true) = trueue #false or ((not true) and false) = falsele # false or ((not true) and true) = false [true, true}, (true, true) #true or ((not false) and false) = trueue #true or ((not false) and true) = true true #true or ((not true) and false) = truee) = true #true or ((not true) and true) = truere true For any values a, b, c (0,1) it should have the property that the call of the formula Formel For any values a, b, c (0,1) it should have the property that the call of the formula Formul f((a == 1, b == 1, C == 1)) gives the same result aslo createTable(1, 3)[0][b][clic Hintsise . You can use the last property to check the correctness of your solution. Your solution should work for any no, not just for n-3 variables. Variablen, A recursive approach may be used to build the nested arrays. Note that the input to function is an array of Boolean values, not an array of values and 1. Accordingly, your und false im zurckgegebenen Array enthalten, so wie es im Beispiel der Fall ist itsprechend soil ihre Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started