*Python*
For the given list:
item_list= [ 2, 6, 13, 17, 22, 25, 29, 31, 38, 42, 47, 55, 59, 63, 68, 71, 77, 84, 86, 90, 99]
Write python code to do a binary search over the given list, where the search value is input by a user (positive integers from 1 to 100 only). Print out the results if the search found the number or not.
def binarySearch(arr, lower, upper, target):
if upper >= lower:
mid = lower + ((upper - lower) // 2)
if arr[mid] == target:
return mid
elif arr[mid] > target:
return binarySearch(arr, lower, mid - 1, target)
else:
return binarySearch(arr, mid + 1, upper, target)
return -1
# Testing
item_list= [ 2, 6, 13, 17, 22, 25, 29, 31, 38, 42, 47, 55, 59, 63, 68, 71, 77, 84, 86, 90, 99]
n = int(input("Enter integer between 1-100 to search from item_list: "))
if(binarySearch(item_list,0,len(item_list)-1,n)!=-1):
print("Number found in the input_list")
else:
print("Number NOT found in the input_list")


*Python* For the given list: item_list= [ 2, 6, 13, 17, 22, 25, 29, 31, 38,...
Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...
Complete function long_list_printer.print_list(). When it's
finished, it should be able to print this list,
a = [
[93, 80, 99, 72, 86, 84, 85, 41, 69, 31],
[15, 37, 58, 59, 98, 40, 63, 84, 87, 15],
[48, 50, 43, 68, 69, 43, 46, 83, 11, 50],
[52, 49, 87, 77, 39, 21, 84, 13, 27, 82],
[64, 49, 12, 42, 24, 54, 43, 69, 62, 44],
[54, 90, 67, 43, 72, 17, 22, 83, 28, 68],
[18, 12, 10,...
Write a python nested for loop that prints out the following pattern 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33...
Please show how you did this in excel.
:13-19 Every home football game for the past eight years at Eastern State University has been sold out. The revenues from ticket sales are significant, but the sale of food, beverages, and souvenirs has contrib- uted greatly to the overall profitability of the football program. One particular souvenir is the football pro- gram for each game. The number of programs sold at each game is described by the following probabil- ity distribution:...
The following data represents the age of 30 lottery winners. 22 26 26 31 38 38 42 44 44 44 45 46 48 50 51 51 52 54 55 60 62 63 71 71 73 75 78 79 80 86 Complete the frequency distribution for the data. Age Frequency 20-29 30-39 40-49 50-59 60-69 70-79 80-89
Find the mean for this list of numbers 51 90 42 38 43 61 6 36 66 55 48 11 84 29 46 Mean - Find the median for this list of numbers 9 28 78 81 41 88 99 27 89 24 30 39 2 63 91 Median-
The number of calls received per week by the clients services of a cell phone company over the last 40 weeks are given as follows: 63 74 42 65 51 54 36 56 68 57 62 64 76 67 79 61 81 77 59 38 84 68 71 94 71 86 69 75 91 55 48 82 83 54 79 62 68 58 41 47 a) Prepare a frequency distribution (table) and histogram for the data. Specify the number of...
81 59 Problem 4 (10 marks) The number of calls received per week by the clients services of a cell phone company over the last 40 weeks are given as follows: 63 74 42 65 51 54 36 56 68 57 62 64 76 67 79 61 77 38 84 68 71 94 71 86 69 75 91 55 48 82 83 54 79 62 68 58 41 47 a) Prepare a frequency distribution (table) and histogram for the data....
Problem 4 (10 marks) The number of calls received per week by the clients services of a cell phone company over the last 40 weeks are given as follows: 63 74 42 65 51 54 36 56 68 57 62 64 76 67 79 61 81 77 59 38 84 68 71 94 71 86 69 75 91 55 48 82 83 54 79 62 68 58 41 47 a) Prepare a frequency distribution (table) and histogram for the data....
63 56 68 Problem 4 (10 marks) The number of calls received per week by the clients services of a cell phone company over the last 40 weeks are given as follows: 74 42 65 51 54 36 57 62 64 76 67 79 61 81 77 59 38 84 71 94 86 69 75 91 55 82 79 68 58 41 47 a) Prepare a frequency distribution (table) and histogram for the data. Specify the number of bins, the...