Question: 1. Using TI Nspire Basic Programming Language, write a program named taut(n), in which the program will test if the statement or Boolean function f
1. Using TI Nspire Basic Programming Language, write a program named taut(n), in which the program will test if the statement or Boolean function f - defined as a global variable - is a tautology or not, where n is the number of the Boolean input variables. This program will use a function named truth(i, n), which takes 2 inputs i and n where i is any possible integers, 0 i 2 n 1 and n is the number of the Boolean input variables of f. This function will convert i to a string of logic: true or false of length n. For example, truth(0, 2) = false, false, truth(1, 2) = false, true, truth(2, 2) = true, false, truth(3, 2) = true, true, truth(0, 3) = false, false, false, truth(1, 3) = false, false, true, truth(2, 3) = false, true, false, truth(3, 3) = false, true, true, . . . truth(6, 3) = true, true, false, truth(7, 3) = true, true, true. Tom P MATH2410 Homework Worksheet 01 P2/4 Example 1, when we run taut(3) to test the program with the following propositional statement or Boolean function f(p, q, r) := ((p q)and(q r)) (p r) It would check all possibilities of the combination of the logic of (p, q, r) = (0, 0, 0), (0, 0, 1), . . ., (1, 1, 1) = (f alse, f alse, f alse),(f alse, f alse, true), . . . ,(true, true, true), and to give a response like: falselst = {}, and dim of falselst = 0. Since dim of falselst = 0, this statement is a tautology. Example 2, when we run taut(3) to test the program with the following propositional statement or Boolean function f(p, q, r) := ((p or q) and ((not p) or r)) (q or (not p)) It would check all possibilities of the combination of the logic of (p, q, r) = (0, 0, 0), (0, 0, 1), . . ., (1, 1, 1) = (f alse, f alse, f alse),(f alse, f alse, true), . . . ,(true, true, true), and to give a response like: falselst = {5}, and dim of falselst = 1. Since dim of falselst > 0, this statement is not a tautology. Note that falselst is a variable that will keep track of when f will yield the truth value of false, for example in Example 2, falselst = {5} because f(true, false,true) false, that is, ((true or false) and ((nottrue) or true)) | {z } true (false or (nottrue)) | {z } false false. Tom P MATH2410 Homework Worksheet 01 P3/4 2. Using TI Nspire Basic Programming Language, write a program to test that for n = 0 and for the first n positive integers, H2n 1 + n 2 , where Hj := 1 + 1 2 + 1 3 + + 1 j . Then using mathematical induction to show that n Z 0 , H2n 1 + n 2 .
Note : I need all answer on Ti Nspire Programmining language code,and also in mathematical form also.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
