Question

In: Computer Science

ATestforPrimalityisthefollowing: Given an integer n > 1, to test whether n is prime check to see...

  1. ATestforPrimalityisthefollowing:

    Given an integer n > 1, to test whether n is prime check to see if it is divisible by a prime number less than or equal to it’s square root. If it is not divisible by an of these numbers then it is prime.

We will show that this is a valid test.

  1. prove

∀n, r, s ∈ N+, r s ≤ n → (r ≤ √n ∨ s ≤ √n)

b) Prove ∀ n ∈ N+ , n is not prime →∃p ∈ N ,(p prime ∧ (p≤√n) ∧ p∣n )

(c) State the contrapositive of the statement of part(b).

Solutions

Expert Solution

1. This statement in plain English says that , for every positive integer n,r,s , if the product of r and s is less than equal to n then this means either or and this statement is correct because if then

Hence the statement given is correct.

2. This statement says that if a natural number n is not prime then this means that there exist some prime number p with p \leq \sqrt{n} such that p | n I.e. p divides n.

Since statement is exactly aligned with property of non-prime number and hence it is correct.

3. The counter positive statement is

This basically means that for every natural number n, if for every integer p, either p is not prime, or p is greater than equal to root n, or p does not divide n, then n is prime

Please comment for any clarification

T<in

syn

T<in

n/r> in

Vn e N+, n is prime → Vp E N(p not prime V (p > n) Vpin)


Related Solutions

A positive integer n is said to be prime (or, "a prime") if and only if...
A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is divisible only by 1 and n . For example, the integers 17 and 29 are prime, but 4, 21 and 38 are not prime. Write a function named "is_prime" that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise. Can you make...
show that an integer n > 4, is prime iff it is not a divisor of...
show that an integer n > 4, is prime iff it is not a divisor of (n-1)!
Write a program in C++ to check whether a number is prime or not
Write a program in C++ to check whether a number is prime or not
in C++ Description: For a given integer n > 1, the smallest integer d > 1...
in C++ Description: For a given integer n > 1, the smallest integer d > 1 that divides n is a prime factor. We can find the prime factorization of n if we find d and then replace n by the quotient of n divided by d, repeating this until n becomes 1.             Write a program that determines the prime factorization of n in this manner, but that displays the prime factors in descending order. (When you find a...
Determine whether there is an integer n > 1 such that there is a projective plane...
Determine whether there is an integer n > 1 such that there is a projective plane of order n (i.e. with n + 1 points on each line) such that n ̸= pk for any prime number p and integer k ≥ 1.
Write a program that takes an integer as input and returns whether it is a prime...
Write a program that takes an integer as input and returns whether it is a prime number or not in C++. (Using if, loops, or/and bool only)
Given a list of positive integers c[0...n − 1], and a positive integer v, decides whether...
Given a list of positive integers c[0...n − 1], and a positive integer v, decides whether we can use numbers from c[0...n − 1] to make a sum of v, allowing any particular number in the list to be used multiple times. Or, mathematically, this means that there exists non-negative integer coefficients, x0, x1, ..., xn−1, such that v = x0c[0] + x1c[1] + ...xn−1c[n − 1]. For example, given c[0...3] = {2, 4, 6, 10}, and v = 17,...
(Prime Numbers) An integer is said to be prime if it is divisible by only 1...
(Prime Numbers) An integer is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not. Write pseudocode and function called isPrime that receives an integer and determines whether the integer is prime or not. Write a test program that uses isPrime to determine and print all the prime numbers between 1 and 1000. Display 10 numbers per line. Twin primes...
Consider the element uniqueness problem: check whether all the elements in a given array of n...
Consider the element uniqueness problem: check whether all the elements in a given array of n elements are distinct answer in pseudo code places
Given a positive integer k and an array A[1..n] that contains the quiz scores of n...
Given a positive integer k and an array A[1..n] that contains the quiz scores of n students in ascending order, design a divide and conquer algorithm to efficiently count the number of students that have quiz scores in (100(i − 1)/k, 100i/k] for integers 1 ≤ i ≤ k. Let group i be the set of students with quiz scores in (100(i − 1)/k, 100i/k] for integers 1 ≤ i ≤ k. The counting result should be stored in G[1..k],...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT