Find the smallest pair of 4-digit numbers such that the difference between them is 303 and their hcf is 101. show your steps.

  1. 23) Find the smallest pair of 4
  2. Find the smallest 4


Download: Find the smallest pair of 4-digit numbers such that the difference between them is 303 and their hcf is 101. show your steps.
Size: 24.15 MB

k

Naive Method is to find all the n*(n-1)/2 possible absolute differences in O(n^2) and store them in an array. Then sort this array and print the kth minimum value from this array. This will take time O(n^2 + n^2 * log(n^2)) = O(n^2 + 2*n^2*log(n)). The naive method won’t be efficient for large values of n, say n = 10^5. An Efficient Solution is based on Binary Search. 1) Sort the given array a[]. 2) We can easily find the least possible absolute difference in O(n) after sorting. The largest possible difference will be a[n-1] - a[0] after sorting the array. Let low = minimum_difference and high = maximum_difference. 3) while low < high: 4) mid = (low + high)/2 5) if ((number of pairs with absolute difference <= mid) < k): 6) low = mid + 1 7) else: 8) high = mid 9) return low We need a function that will tell us the number of pairs with a difference <= mid efficiently.Since our array is sorted, this part can be done like this: 1) result = 0 2) for i = 0 to n-1: 3) result = result + ( Here Output 1 Time Complexity: O(nlogn) Auxiliary Space: O(1) Suppose, the maximum element in the array is, and the minimum element is a minimum element in the array is . Then time taken for the binary_search will be, and the time taken for the upper_bound function will be So, the time complexity of the algorithm is . Sorting takes . After that the main binary search over low and high takes time because each call to the function countPairs takes time . So the Overall time complexity would be Thi...

23) Find the smallest pair of 4

23) Find the smallest pair of 4-digit numbers such that the difference between them is 303 and their HCF is 101. Show your steps. 24) If cos ( A + 2 B ) = 0 , 0 ∘ ≤ ( A + 2 B ) ≤ 9 0 ∘ and cos ( B − A ) = 2 3 ​ ​ , 0 ∘ ≤ ( B − A ) ≤ 9 0 ∘, then find cosec ( 2 A + B ) ). Show your work. OR State whether the following statements are true or false. Give reasons. (i) As the value of sin θ increases, the value of tan θ decreases. (ii) When the value of sin θ is maximum, the value of cosec θ is also maximum. 23) Find the smallest pair of 4-digit numbers such that the difference between them is 303 and their HCF is 101. Show your steps. 24) If cos ( A + 2 B ) = 0 , 0 ∘ ≤ ( A + 2 B ) ≤ 9 0 ∘ and cos ( B − A ) = 2 3 ​ ​ , 0 ∘ ≤ ( B − A ) ≤ 9 0 ∘, then find cosec ( 2 A + B ) ). Show your work. OR State whether the following statements are true or false. Give reasons. (i) As the value of sin θ increases, the value of tan θ decreases. (ii) When the value of sin θ is maximum, the value of cosec θ is also maximum. Updated On Feb 1, 2023 Topic All topics Subject Mathematics Class Class 9 Answer Type Video solution: 1 Upvotes 97 Avg. Video Duration 1 min

Find the smallest 4

First we have to find the LCM of 8 , 2 0 and 2 4 ∴ LCM of given numbers = 2 × 2 × × 2 × 3 × 5 = 1 2 0 Greatest number of 3 digit is 9 9 9 We divide 9 9 9 by 1 2 0 and find the remainder According to given condition , we need a greatest 3-digit number which is exactly divisible by 1 2 0 ∴ The required number = 9 9 9 − 3 9 = 9 6 0