person is trading his money in the stock exchange market. Assume that the daily price of a specific market along a certain period of time is given as follows: Price [200, 500, 800,100, 300, 50] all in Dollar. This means that the price of the stock in the first day is 200$ and the day after which is mean the second day the price is going up to be $500 and so on A
Q: If the statement q ∧r is true, determine all combinations of truth values for p and s such that the…
A: All combinations are stated in step2.
Q: A cylindrical tank of height H and radius r with a hemispherical cap on each end (also of radius, r)…
A: Matlab Code:- % height of the cylinderH = 10;% radius of the cylinderr = 3; % defining array of…
Q: The function f(x)=x2 from set of positive real numbers to positive real numbers is __________
A: Bijective
Q: (A) lim (x +VI - x -Jx) equals to (р) sin 2x – 2 tan x is In (1 + x³) (B) The value of the lim (q)…
A: solution :
Q: Population growth at a constant annual growth rate of r% is governed by a simple equation: Pn = Pn-1…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: 2. A certain company gives commission to each of their salesmen based from the type of appliance…
A: Here there are multiple questions so I have answered the question which is upper in the pic. Put…
Q: Let f(x)=ax+b and g(x)=cx+d, where a, b, c, and d are constants. Determine necessary and sufficient…
A: Given: Let f(x)=ax+b and g(x)=cx+d, where a, b, c, and d are constants. Determine necessary and…
Q: n python programming, i) In the year 1752, the Gregorian Calendar was adjusted. Eleven days were…
A: import datetime def Startingday(year):a = datetime.datetime(year, 1,…
Q: A student wants to find out his final grade.There are three quizzes worth 10 points each, a midterm…
A: #include <stdio.h>int main(){ int q1,q2,q3,mid_term,final; float…
Q: rent his house on certain conditions that uld be followed in terms of programming
A: a landlord needs to rent his house on certain condition that needs to be fulfilled what so ever what…
Q: We are buying a guidebook and a towel for a total sum of 110 dollars. The guidebook costs 100…
A: Let the cost of guidebook be g. Let the cost of towel be t.
Q: Let p be the statement "I fix my car," q be the statement "I will be able to sleep," and r be the…
A: Given statement, , and whether the statement "Either I fix my car or I will not be able to sleep,…
Q: Identify each declared variable along with its scope in each of the following example expressions.…
A: Answer: variables: a. x b. x, y c. ls
Q: 2. A certain company gives commission to each of their salesmen based from the type of appliance…
A: 2. A certain company gives commission to each of their salesmen based from the type of appliance…
Q: Which statement explains why x* is not O(x)? The function f(x) = x does not have an upper bound %3D…
A: In statement 1 the statement states that x3 is less than x4 which is true that x3 can never be…
Q: Calculate income tax for the given income by following the below rules: Total Income Rate (in %)…
A: In the above code, it has been asked to print the income tax on the given income, in the following…
Q: Let A = {a, b, c}, B = {x, y}, and C = {0, 1}.
A: Let A = {a, b, c}, B = {x, y}, and C = {0, 1}.
Q: If A=[1,2,3;4,5,6;7,8,9], then B=A([1 2],[1 2]) is
A: Given A = [1,2,3; 4,5,6; 7,8,9] So, A looks like 123456789
Q: The statement "There is a real number x such that for all real number y, xxy3D0". If O y)=xxy3D0,…
A: Objective: The mathematical notation for the statement should be chosen from the four alternates.…
Q: The electricity accounts of residents in a very small town are calculated as follows: a) If 500…
A: ip = [200, 500, 700, 1000, 1500]; for i=1:5 un = ip(i); ct = 0; if un <= 500 ct = un * 0.02;…
Q: Please answer it in Python Anna has to manage the stocks of a window warehouse, week by week. The…
A: c = input("Please select option from below : \na. Stock forecasts\nb. Stock maximal\nq.…
Q: The horizontal displacement with respect to time, t, as x(t) and vertical displacement y() are given…
A: Here, we have given the time in milliseconds. Here we have drawn three plots. Time vs horizontal…
Q: A ski rental agency has n pairs of skis, where the heigh are n skiers who wish to rent skis, where…
A: Greedy Approach: For the above problem, the optimal solution will be when both the arrays are…
Q: (Poor Person's Logarithm) For this question, we will be given a number x and a base b and will find…
A: Below is the code in C++ and sample output:
Q: 82. Match the statements of Column I with values of Column II. Column I Column II (A) If f(x) x +1…
A: ANSWER : Option A is correct Answer.
Q: (c) If x and y are integers such that x > 1, and x divides y, then xł(y+1).
A: - The question is to prove that if x and y are integers and X is greater than 1 and X divides Y…
Q: Correct answer will be upvoted else downvoted. Computer science. Polycarp recalled the 2020-th…
A: Here, we have to find the solution to the above problem. I wrote the program in Python programming…
Q: Considere the following variable. ]: Students_Info={'lloyd' : { "name": "Lloyd", "homework":…
A: In python, function is defined using def keyword. The syntax is, def function_name():…
Q: he seller has a whole new store for sale "buy 2, get 1 for free". or legal reasons, they are unable…
A: import java.util.ArrayList; import java.util.List; import java.util.Scanner; import…
Q: Suppose we have a nice young couple who borrow $700000 from the bank, at an annual interest rate of…
A: monthly.payment<-2000 im<-(1+3.124/100)^(1/12) # annual interest is in percentage convert into…
Q: (a) Given an n x 2 matrix X, we can move the shape represented by the coordinates in X by a in the…
A: Below find the solution !! (a) shift <- function(X,a,b){ X[,1] <- X[,1] + a X[,2] <- X[,2]…
Q: Let i, j ∈ Za and w, x ∈ Zb with i, j different from each other and w, x different from each other.…
A:
Q: string of length L. If both frequency and linear mass density are kept the same while the tension in…
A: The number of harmonic is the number of loops formed in the standing wave. So, if we calculate the…
Q: If fn → f and gn → 9, show that fn ^ gn → f ^ g and fn V gn → f g.
A: Note that fn Ʌ gn=fn+gn2-fn-gn2 Let x∈Xsince fn→f⇒fn(x)→f(x) gn→g⇒gn(x)→g(x).…
Q: A particular school offers cash rewards to children based on their score history. During an l-day…
A:
Q: here is a promotional offer in a bookstore "Take 3, pay for the 2 more expensive ones". So, each…
A: #include <iostream> #include <math.h> #include <algorithm> //#include…
Q: Given bags are labelled to any or all the coins in every bag have an equivalent weight. Some bags…
A: The Answer is
Q: A bank teller has money available in the form of 4 denominations of 1, 5, 50, and 100. Whenever a…
A: Lets see the solution.
Q: The electric flux density D at the point M (0,4,0) in the region about a uniform line charge of 1…
A:
Q: A store has two different coupons that customers can use. One coupon gives the customer $30 off…
A: Hi. Before moving to the solution in the next step, let's understand how nested function calls are…
Q: all integers between -4 and 4, and the domain for y consists of all real numbers. Determine the…
A: As per the answering guidelines, solving first 3 sub question 1. There exists some x and for all y…
Q: If f(n) = O(g(n)), then g(n) = Ω(f(n))
A: Given : - The functions f(n) and g(n) be functions with domain {1, 2, 3, . . .} Asymptotic analysis…
Q: There is some bad news to be delivered, and X has taken on the dangerous mission. Nobody really…
A: This is a basic programming problem named "Jospehus Circle" Since they are asking the implementation…
Q: Fix the example such that the cost of frozen yogurt is O if you pour exactly 1 Ib. in your cup. * 1…
A: Here, we are checking if weight is less than 1 and also weight is greater than 1 So, you can add the…
Q: Q3) Predict the following: h is a human and devil is not human p is peace and war is not peace…
A:
Q: (b) Determine the value of k, such that If (2.0,k)-f(2.0, k − 1)| < €, where € = N. 1 10-8 and k €
A: The math module is a standard module in Python and is available at all times. To use the math…
Q: An amortization calculator is used to determine the periodic payment amount due on a loan (typically…
A: A = P(i + i/((1+i)^n-1)) where, A = periodic payment amount. P = amount of principle. i = periodic…
Q: QI: The Collatz conjecture function is defined for a positive integer m as follows. (COO1) g(m) =…
A: ## As no language is mentioned, we write the code in Python language. def g(m):…
Q: In the following, f(x), g(x) and h(x) are all positive value real functions. (Note: Answer true if…
A: As per our guidelines, only 3 sub parts will be answered. So, please repost the remaining questions…
note : Build your
Step by step
Solved in 3 steps with 7 images
- A person is trading his money in the stock exchange market. Assume that the daily price of a specific market along a certain period of time is given as follows: Price [200, 500, 800,100, 300, 50] all in Dollar. This means that the price of the stock in the first day is 200$ and the day after which is mean the second day the price is going up to be $500 and so on until the end of the week or the list you are given. You are allowed to buy and sell the stock onlyonce, which means that if you buy it on the first day then you will pay 200$ then if you decided to sell it on the third day then you will get $800 the your profit will be $600. another example: prices={300,450,720,90,30,50,900,500,70} output: Buying date: day5, at the price of $30 selling date : day7, at the price of $900 Maximum profit:$870 You are requested to develop an algorithm to maximize the profit in single buy and sell.Write code in C++, C# or Python to solve the following problem: In a party there are N persons and we have M raffles. One person may participate in any number of raffles (from 0 to M). At the end of the day, host of the party comes to you and gives you M lists. Each list contains multiple integer numbers which are the "raffle ID numbers" of the participants. Then, for each list an integer number, I, is announced to determine the winner of the raffle: the winner is the person with raffle ID number K such that K is larger than exactly I numbers in that list. To help the host to find the winners you want to write a program. Input Format First line of the input is N and M. Then, there are M lines, each one contains integer numbers between 1 and N. Each list may contain at most N numbers. At the end of each line there is -1. After these lines there is one line which contains M integers to announce the winners. If the j-th number in this line is I it means that the winner of list j…Suppose a list contains marks earned in the courses CSE110, PHY111, and MAT110 of each student consecutively in a nested list form. Your task is to take a course name as input from the user and sort the list based on the marks obtained in that course in order to finally print the names of the students in descending order of marks obtained i.e. from the student who earned the highest marks to the student who earned the lowest. For example, the list may look likelst = [ ["Alan", 95, 87, 91], ["Turing", 92, 90, 83], ["Elon", 87, 92, 80], ["Musk", 85, 94, 90] ]where for each nested list, 1st index holds the name of the student, 2nd index is total marks earned in the CSE110 course, 3rd index is PHY111 marks and 4th index is MAT110 marks. ===================================================== Hint:You may create a function for sorting, then call it every time when needed instead of rewriting the code. You may get the data in the individual lists from the given nested list.…
- (a) Write a function top_students(marks) that takes as a parameter a non-empty list of (name, mark) tuples, where name is the name of a student (a string) and mark is the student's mark for some course (an int). The function returns a list of the names of all students whose mark equals that of the top student. If there is just a single student with the maximum mark, the return value will be a list of length 1, as in the first example in the table below. The names in the return list should be in the same order as in the input parameter list. Test Result marks = [('Beatrice', 50), ('Nerly', 90), ('Uniza', 70)] print(top_students(marks)) ['Nerly'] marks = [('Beatrice', 80), ('Nerly', 75), ('Uniza', 66), ('Joshua', 80)] print(top_students(marks)) ['Beatrice', 'Joshua'] (b) Write a function char_counts(string) that takes a string as a parameter and returns a dictionary in…Suppose a list contains marks earned in the courses CSE110, PHY111, and MAT110 of each student consecutively in a nested list form. Your task is to take a course name as input and sort the list based on the marks obtained in that course to finally print the names of the students in descending order of marks obtained i.e. from the student who earned the highest marks to the student who earned the lowest. For example, the list may look like stu_lst = [ ["Alan", 95, 87, 91], ["Turing", 92, 90, 83], ["Elon", 87, 92, 80], ["Musk", 85, 94, 90] ] where for each nested list, 1st index holds the name of the student, 2nd index is total marks earned in the CSE110 course, 3rd index is PHY111 marks and 4th index is MAT110 marks. [You cannot use python build-in sort() function, you can call your own sort function or copy your code from previous tasks instead] =============================================================== Sample Input 1 MAT110 Sample Output 1 ['Alan', 'Musk', 'Turing', 'Elon']…Suppose a list contains marks earned in the courses CSE110, PHY111, and MAT110 of each student consecutively in a nested list form. Your task is to take a course name as input and sort the list based on the marks obtained in that course to finally print the names of the students in descending order of marks obtained i.e. from the student who earned the highest marks to the student who earned the lowest. For example, the list may look like stu_lst = [ ["Alan", 95, 87, 91], ["Turing", 92, 90, 83], ["Elon", 87, 92, 80], ["Musk", 85, 94, 90] ] where for each nested list, 1st index holds the name of the student, 2nd index is total marks earned in the CSE110 course, 3rd index is PHY111 marks and 4th index is MAT110 marks. [You cannot use python build-in sort() function, you can call your own sort function or copy your code from previous tasks instead] =============================================================== Sample Input 1 MAT110 Sample Output 1 ['Alan', 'Musk', 'Turing', 'Elon']…
- Write in C++ Now, what if Sam wants to insert Eevee after Pikachu but he doesn't know where Pikachu is located in his list. Let's help him search for a Pokemon by its name and insert another Pokemon directly after it. Write a function secondPlace() that takes six parameters and inserts a new Pokemon into a list right after another specified pokemon. Once you find the specified Pokemon, use the insertAfter() function from the previous sub-question to add the new Pokemon. The function should return the new number of strings in the array. Note The same Pokemon may appear in the list multiple times (Sam has a bad memory). Assume that Sam wants every instance of the Pokemon he is searching for to be followed by the Pokemon he is attempting to insert. If the array is already full or if the number of strings that are going to be added to the array plus the current number of strings exceeds the total size of the array, the array should remain unchanged. Assume all inputs are lowercase…Computer Science (in picat) 10. split list(Lst,N): split Ist into two parts with the first part having N elements, and return a list that contains these two parts. 12. min max median(st): a function that takes a simple list of numbers Ist as a parameter and returns a list with the min, max, and the median of Ist. Can you devise an algorithm that has an expected linear running time?rite a function numPairs that accepts two arguments, a target number and a list of numbers. The function then returns the count of pairs of numbers from the list that sum to the target number. In the first example the answer is 2 because the pairs (0,3) and (1,2) both sum to 3. The pair can be two of the same number, e.g. (2,2) but only if the two 2’s are separate twos in the list.In the last example below, there are three 2’s, so there are three different pairs (2,2) so there are 5 pairs total that sum to 4. Sample usage: >> numPairs( 3, [0,1,2,3] )2
- Suppose a list contains marks earned in the courses CSE110, PHY111, and MAT110 of each student consecutively in a nested list form. Your task is to take a course name as input from the user and sort the list based on the marks obtained in that course in order to finally print the names of the students in descending order of marks obtained i.e. from the student who earned the highest marks to the student who earned the lowestthis code should be in python: write a function that receives a list as its only parameter. Inside the function remove all the duplicate items from the list and returns a new list. For Example: If we call the function with [“dad”, “aunt”, “mom”, “sister”, “mom”] as its input, the returned value should be [“dad”, “aunt”, “mom”, “sister”]. The order of the items inside the returned list does not matter.The English HOD asked you to write a small program to assist the English teachers toRAMDOMLY assign learners to do their oral examinations. Each teacher has adifferent number of learners in their class, so they will have to put in the number ofstudents on a form. The program should then randomly return a number (which areallocated to each learner on the teacher’s class list) AND check whether the newlyallocated number has not been used before. Your program therefor only has to returnthe following output:Slot 1 – Learner number 37Slot 2 – Learner number 23Slot 3 – Learner number 18Slot 4 - Learner number 7Slot 5 – Learner number 1 (etc.)You decided that this will be a fun project to give to your IT learners. a. Write a memo (which includes the whole program code)b. Indicate how you will assess and allocate marks to the learners.