Question

In: Computer Science

Determine whether the following arguments are valid. Explain your answer. If it is hot outside, I...

  1. Determine whether the following arguments are valid. Explain your answer.
    1. If it is hot outside, I will not go to play.
      If I play, I will not study.
      If I study, I will do good in the exam.
      I did good in the exam.
      Therefore, it is hot outside.

  1. If I can run faster than air plane or I can kill a lion then I am a super human.
    If I am a super human then I am very careful about my diet.
    I am careless about my diet.
    Therefore, I cannot kill a lion.
  1. How many times the “hello world” will be printed in the following algorithm if n =100:  

int Function(int n)
{
      for(int i = 0; i < n; i++)

      {

                  for(int j = 0; j < n; j++)

                  {

                              for(int k = 0; k < n; k++)

                              {

Print(“hello world”);

}

}

}

}

Solutions

Expert Solution

1.

Let the following symbols denote the given statements :

h : it is hot outside

p : I will go to play

s : I will study

e : I will do good in 'exam'

The given premises are :

  • h -> ~p
  • p -> ~s
  • s -> e
  • e

The conclusion to be proved is :

h

Let R be ( ( h -> ~p ) ∧ ( p -> ~s )  ∧ ( s -> e ) ∧ e ).

We need to show the truth value of ( ( h -> ~p ) ∧ ( p -> ~s )  ∧ ( s -> e ) ∧ e ) -> h

Let's use truth table for the given argument :

h p s e ( h -> ~p ) ( p -> ~s ) ( s -> e ) R R -> h
0 0 0 0 1 1 1 0 1
0 0 0 1 1 1 1 1 0
0 0 1 0 1 1 0 0 1
0 0 1 1 1 1 1 1 0
0 1 0 0 1 1 1 0 1
0 1 0 1 1 1 1 1 0
0 1 1 0 1 0 0 0 1
0 1 1 1 1 0 1 0 1
1 0 0 0 1 1 1 0 1
1 0 0 1 1 1 1 1 1
1 0 1 0 1 1 0 0 1
1 0 1 1 1 1 1 1 1
1 1 0 0 0 1 1 0 1
1 1 0 1 0 1 1 0 1
1 1 1 0 0 0 0 0 1
1 1 1 1 0 0 1 0 1

The final output that is R -> h or in other words, ( ( h -> ~p ) ∧ ( p -> ~s )  ∧ ( s -> e ) ∧ e ) -> h is not a tautology.

Hence, the given argument is not valid.

2.

Let the following symbols denote the given statements :

a : I can run faster than air plane

l : I can kill a lion

s :  I am a super human

d : I am very careful about my diet

The given premises are :

  • ( a v l ) -> s
  • s -> d
  • ~d

The conclusion to be proved is :

~l

The given argument can be proved using the following table :

Statement no. Statement Justification
1 ( a v l ) -> s given
2 s -> d given
3 ~d given
4 ~s Modus tollens rule on statements 2 and 3
5 ~(a v l ) Modus tollens rule on statements 1 and 4
6 ~ a ∧ ~ l De Morgan's Law on statement 5
7 ~l Simplification rule on statement 6

The conclusion, ~l, can be derived from the given premises.

Hence, the given argument is valid.

3.

In the function, there are 3 for loops which are independent of each other and runs for O(n) times each.

So, total number of times the function executes is O(n^3) times.

Here, n = 100.

Then, the number of times the statement “hello world” will be printed is ( 100 * 100 * 100 ) = 1000000 times.

Hence, the answer is 1000000 times.


Related Solutions

use truth tables to determine whether or not the following arguments are valid: a) if jones...
use truth tables to determine whether or not the following arguments are valid: a) if jones is convicted then he will go to prison. Jones will be convicted only if Smith testifies against him. Therefore , Jones won't go to prison unless smith testifies against him. b) either the Democrats or the Republicans will have a majority in the Senate. but not both. Having a Democratic majority is a necessary condition for the bill to pass. Therefore, if the republicans...
2. Determine whether the following Propositional Logic statements are valid or invalid arguments. You may use...
2. Determine whether the following Propositional Logic statements are valid or invalid arguments. You may use a truth table, proofs using rules of inference, or resolution (specify which method you are using). (a) p→q, ~q→r, r; ∴p (b) ~p∨q, p→(r∧s), s→q; ∴q∨r (c) p→(q→r), q; ∴p→r
Please use any of the methods to prove whether each of the following arguments is valid...
Please use any of the methods to prove whether each of the following arguments is valid or invalid. For each problem, please identify the method that you have decided to employ and make sure to show your work. 1. It is obvious that nuclear energy is needed. Nuclear energy is needed if and only if solar energy cannot be harnessed. And it is also true both that solar energy can be harnessed only if funds to do so are available,...
Determine each of the following arguments’ forms to be valid or invalid. You may use the...
Determine each of the following arguments’ forms to be valid or invalid. You may use the Venn Diagram proof method, the rules/fallacies method, or any other method, of your choice. 1. Some athletes are not baseball players and some baseball players are not basketball players. Therefore, some athletes are not basketball players.2. All creationists are fundamentalists because all fundamentalists are religious people and all creationists are religious people. 3. As no conservationists are litterers, no environmentalists are litterers, because all...
a) Use truth tables to show that the following are valid arguments: i. [p  (p...
a) Use truth tables to show that the following are valid arguments: i. [p  (p → q)] → q ii. [(p → q) ∧ (q → r)] → (p → r) b) Use truth tables to show the logical equivalence of: i. (p → q) ⇔ (¬p ∨ q ) ii. (¬p ∨ q) ∨ (¬p  q) ⇔ p
Determine whether each of the following is an internal control strength or weakness. Explain your answer....
Determine whether each of the following is an internal control strength or weakness. Explain your answer. 1. Receiving department manager places an order with the vendor for merchandise inventory. 2. A voucher is used to certify a transaction and authorize recording of the liability. 3. Goods are received by the receiving department and documented with a receiving report. 4. Accounting department pays the vendor's invoice before goods are received. 5. Invoices are paid after completion of the invoice approval documenting...
a) Indicate whether each of the following guarantees is considered insurance. Explain your answer. i) A...
a) Indicate whether each of the following guarantees is considered insurance. Explain your answer. i) A television set is guaranteed by the manufacturer against defects for 90 days. ii) A large group of homeowners agrees to pay for losses to homes that burn during the year because of fire. iii) I bet the insurance company $300 against $100,000 that my house will burn.
Determine whether the following statements are TRUE or FALSE. Briefly explain your answer. Q1) “The rate...
Determine whether the following statements are TRUE or FALSE. Briefly explain your answer. Q1) “The rate of returns of a bond is always the same as the yield to maturity of the bond.” Q2) “The nominal interest rate is always higher than the real interest rate.” Q3) “If the actual inflation rate is unexpectedly high, the realized real interest rate can be negative.”
Validity, Soundness, Strength, Cogency - Practice Arguments 2 Determine whether each of the following arguments is...
Validity, Soundness, Strength, Cogency - Practice Arguments 2 Determine whether each of the following arguments is a deductive argument or an inductive argument. If the argument is a deductive argument, then evaluate the argument for its validity and soundness. If the argument is an inductive argument, then evaluate the argument for its strength and cogency. Use the selection lists beneath each argument to indicate your answers. Argument A An aardvark is (deductive/inductive) , (valid/invalid/strong/weak) , and (sound/unsound/cogent/uncogent) . Argument B...
10. Determine whether the following statements are true or false. You must briefly explain your answer....
10. Determine whether the following statements are true or false. You must briefly explain your answer. (a) If Yn is a binomial rv with parameters n and p = 1/n, then limn→∞ Yn is a exponential random variable. (b) If (X, Y ) is uniformly distributed on the unit disk, then X is uniformly distributed on [−1, 1]. (c) If X1, ..Xn, .. are i.i.d. with common mean µ and variance σ 2 , then for any > 0 P(|X1...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT