/* Write a function `coinProblem` that takes * 3 arguments: N, M and K; and solves following * problem: * If you have exactly 1 coin value N and infinite * amount of coins value M, is it possible to choose * coins so that, sum of their value is equal to K? * Return true if it is possible, false otherwise. * * For example: * N = 1, M = 3, K = 7 * 3+3+1 => Yes %3D * * N = 1, M = 10, K = 7 * Answer is No. As we have only one (N=1) coin and M coi * have value higher than K. */ %3D %3D coinProblem :: Int Int Int -> Bool // Start = coinProblem 1 3 7 // True // Start = coinProblem 1 10 7 // False // Start = coinProblem 3 10 3 // True // Start = coinProblem 5 10 50 // True // Start = coinProblem 3 4 21 // False %3D
Q: List security vulnerabilities as per Open Web Application Security Project (OWASP).
A: the answer is given below:-
Q: What is the concept of AWS?
A: The full form of AWS is Amazon Web Services. It is a platform that offers flexible, reliable, scalab...
Q: What is the distinction between a White Hat and a Black Hat Hacker?
A: Introduction: While white hat hackers look for and solve security flaws in a system, black hat hacke...
Q: write a user defined function to find nth element from a list using LISP ( use car and cdr functions...
A: the answer is given below:-
Q: If you wanted to know the position of the letter v (i.e. return 2) in the String str containing the ...
A: A String is a pre defined class in Java which has various methods in it to perform the operations on...
Q: Please Answer this in C++: Write code to read a list of song durations and song names from input. ...
A: #include <iostream> #include <string> #include <vector> using namespace st...
Q: Create a program that allows you to view and edit the sales amounts for each month of the current ye...
A:
Q: To transmit the data 1011000 to his friend using hamming code technique. Calculate (i) number of red...
A: The hamming code provides a sequence of bits that will help to detect errors in transmission over a ...
Q: Hello, the code task below has to be written in python 3 and the HTTP must show the html file from t...
A: Answer: Code#import socket modulefrom socket import *import datetime import threading#classclass Thr...
Q: The representatives to the United Nations from different countries meet for a summit. After a few co...
A: Here discuss about graph coloring : ================================================================...
Q: Why were sequence numbers required in our rdt protocols?
A: Introduction: Reliable data transfer protocols (RDT, RDP) are algorithmic procedures that ensure the...
Q: Decrite how web caching Can reduce delary in recimng a reguested btject
A: Web caching is a process of storing the data for reuse, such as a copy of a web page served by the w...
Q: In a Layer 1 frame, what information is normally provided?
A: Answer: In the OSI reference model, there is seven-layer. 1. Physical Layer 2. Data Link Layer 3. N...
Q: Is the statement ∼(p∨q)∧p a tautology, contradiction, or neither? Group of answer choices Tautology...
A: Introduction: It is important to note that "a tautology is a formula that is "always true," that i...
Q: How does your mobile phone work?
A: answer is
Q: QUESTION 4 1. What is the purpose of a Work Breakdown Structure?
A: Work Breakdown Structures conveys the meaning by its name itself that is entire work is divided into...
Q: Explain oops concepts..with suitable example
A: Object-oriented programming is a programming paradigm in which there is a specific way of writing co...
Q: Question:: In what cases would you advocate the use of assembly language code in the creation of app...
A: Introduction: Assembly language employs mnemonic codes, which are equivalent to English words. Altho...
Q: Configure the OSPF process on all routers for a single area-0 (backbone) and advertise its directly ...
A: Introduction: Open Shortest Path First (OSPF) is an IP network link-state routing protocol that is b...
Q: Find the generating function for the following sequend ɔ, 1, 0,0, 1, 0, 0, 1, 0, 0, 1. You need to e...
A:
Q: Describe the TM that accepts the language, L= {w e {a,b,c}* | w contains equal number of a's, b's an...
A: Language produces six types of character units and a, b, c can be in any form but contains the same ...
Q: consecutive Os. For example, 1011011101, 011010 etc. How many good binar strings of length k are the...
A: SUMMARY: - Hence, we discussed all the points.
Q: It is between the operating system and the video controller card at this point.
A: Introduction: Graphics and video controllers are expansion cards that are used to create and output ...
Q: What will be the impact of the internet of things (IoT) on our everyday lives? Justify your position...
A: According to the information given:- We have to define the internet of things on our everyday lives ...
Q: Write a function named validate that takes code represented as a string as its only parameter.
A: Explanation: Create a function named validate that will validate if the code is right or wrong. Cre...
Q: An 8-bit register contains the Hex value A9. What is the register value after an arithmetic shift ri...
A: Hexadecimal is a position that acquires the base 16 values consisting of 16 symbols. For eg, the hex...
Q: Which of the following statements about tokens is FALSE? Ethereum tokens, whether they’re ERC20-com...
A: Which of the following statements about tokens is FALSE?
Q: 2. Answer the following questions: a. What is the article all about? b. Why do you think it is impor...
A: The article is all about understanding the difference between Data security and Data privacy.
Q: Show that AES decryption is the inverse of AES encryption.
A: Introduction: The Advanced Encryption Standard (AES) is a symmetric block cipher that the United Sta...
Q: How are the words "receive" and "returns" used in the suggested procedure?
A: Receive : Receiver (album), the second and last album by the band Farmer Not So John, released in 19...
Q: Give an example of a word then define and describe it in a well-explained manner, prefereably paragp...
A: Answer: 1. Define: Definition- To determine or identify the essential characteristics or meaning of ...
Q: Write a C Program to demonstrate pointers to functions in a menu-driven program. The program should ...
A: The solution is given below for the above given question:
Q: This is how you write a CALL statement that calls a procedure called MyProc in an outside link libra...
A: Call statement given below
Q: In a computer with a 32-bit data-bus, how many 4-bit wide memory components are used? the answer to ...
A: A data bus is a PC subsystem that considers the moving of information starting with one part ...
Q: Question:: In what cases would you advocate the use of assembly language code in the creation of app...
A: Introduction: Assembly language employs mnemonic codes, which are equivalent to English words. Altho...
Q: can you please answer number 4 for me 1. Create a class called Student, with the following attri...
A: Class declaration is given below: public class Student{private String studentName;private int studen...
Q: What exactly is open source in the field of computer science?
A: Given :- What exactly is open source in the field of computer science?
Q: Juestion:: and Q are two processes that share a set of variables that is common. The variable includ...
A: Introduction: In this case, either process can run first. A procedure may also be preempted by anoth...
Q: What prompted the invention of the computer?
A: the answer is given below:-
Q: In NumPy write a program to generate a list that contain 5 random integers in the range 1 to 100. Di...
A: Python NumPy to generate list of 5 random number of range 1to 100
Q: Write a procedure Push (x, S) that pushes element x onto stack S, where S is one or the other of the...
A: First of all we should know why two stacks start from the opposite side.This is because so that we c...
Q: Formatting is m Select one: a. Text Tablo
A: Explanation:The way photos, text, and tables are grouped and arranged in a word processor is referre...
Q: You have the IPV6 address: fe80 : 7285: c2ff: fea7: a4c7 What kind of address is this and how is it ...
A: Find the solution below of above question. I hope this will meet your requirements.
Q: Answer this question fast
A: SUMMARY: - Hence, we discussed all the points.
Q: An.dll file called kernel32.dll is what kind of file?
A: Introduction: An.dll file called kernel32.dll is what kind of file
Q: Which firewall security strategy would be the best solution for the scenario? Why?
A: Introduction: Here we are required to provide the best security strategy that would be best for the ...
Q: What is the most effective method for determining the size of a software product
A: The most effective method of determining the size of a software product by comparing it with the exi...
Q: Create a BNF grammar using a parsimonious Python module. This should consist of a first name, space,...
A: Answer: BNF grammar to represent a nameThe name generally represented in three partsfirstname middle...
Q: What is the smallest 32-bit floating point number f such that 128 + f > 128 ? What is the smallest 3...
A: Floating-point numbers are those number that contains the real part as well as the fractional part f...
Q: P and Q are two processes that share a set of variables that is common. The variable includes: seq, ...
A: Here either of the process can execute first. Also a process can be preempted by another process. T...
Clean IDE, a function on Clean language.
Step by step
Solved in 3 steps with 1 images
- Code in Python Write a function, print_integers_less_than(n), which takes an integer parameter n and prints each integer k which is at least 0 and is less than n, in ascending order. Hint: use a simple for loop. For example: Test Result print_integers_less_than(2) 0 1 print_integers_less_than(5) 0 1 2 3 4 print_integers_less_than(-3)Part (a) Write a python function that computes the binomial coefficient ("). The function should return the correct answer for any positive integer n and k where k=m pass Part (c) Suppose that the number of people in the trial is 100. Then: • Plot a curve that shows how the probability of type 1 error changes with the choice of m, for m = 1,...n assuming that the null hypothesis holds (in red), • On the same picture, plot the probability of type 2 error vs the value of m in the case in which the new drug is effective with proability 0.68 (in blue). You can plot the two curves using matplotlib.pyplot. You can select the color by passing color='r' or color='b' to the plt.plot() function. [4]: n - 100 # your code here def plot_curve (): pass [5]: plot_curve() Part (d) Based on the picture above, what value of m do you think would be suitable to keep both type 1 and type 2 error small at the same time? (You may assume that the company claims the new drug has 68% accuracy) [6]: # your…code in python (A) please Solve the so-called "Birthday Problem". Write a program that takes an integer ?N and uses the function np.random.randint (low = 0, high = N) from numpy to generate a random sequence of integers between 00 and ?−1N−1. Run experiments to validate the hypothesis that the number of integers generated until the first repeated value is approximately ?∗?2⎯⎯⎯⎯⎯⎯⎯√π∗N2. a) Write a function birthday(N) that returns the number of values generated until a value is repeated as a function of the range of possible values ?N (from 00 to ?−1N−1); b) Write a function birthday_sim(N) that repeats birthday(N) a total of n_sim = 20000 times and returns the average of all the numbers generated; c) Show on one plot that as ?N increases (with a doubling experiment), from ?=2N=2 to ?=1000N=1000, the value of birthday_sim(N) approaches ?∗?2⎯⎯⎯⎯⎯⎯⎯√π∗N2.
- Write a void function to find the average score on each test and store in an array testAvgs. Write a void function to print the average score for each student, i.e. print the contents of the array studentAvgs. The output will be well formatted and accompanied with appropriate messages. Write a void function to print the average score on each test, i.e. print the contents of the array testAvgs. The output will be well formatted and accompanied with appropriate messages. Add the following declaration for the array studentsPassing in the function main. bool studentsPassing[MAX_STUDENTS]; Write a function that initializes all components of the array studentsPassing to false. The array studentsPassing is a parameter. void Initialize(bool studentsPassing[],int numberOfStudents) Write a function that has studentsPassing , studentAvgs, and numberOfStudents as parameters. Set the components of passing to true whenever the corresponding value in studentAvgs is greater than or equal to 50.0…There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. Example There is one pair of color and one of color . There are three odd socks left, one of each color. The number of pairs is . Function Description Complete the sockMerchant function in the editor below. sockMerchant has the following parameter(s): int n: the number of socks in the pile int ar[n]: the colors of each sock Returns int: the number of pairs Input Format The first line contains an integer , the number of socks represented in .The second line contains space-separated integers, , the colors of the socks in the pile. Constraints where Sample Input STDIN Function ----- -------- 9 n = 9 10 20 20 10 10 30 50 10 20 ar = [10, 20, 20, 10, 10, 30, 50, 10, 20] Sample Output 3 Explanation There are three pairs of socks.There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. Example There is one pair of color and one of color . There are three odd socks left, one of each color. The number of pairs is . Function Description Complete the sockMerchant function in the editor below. sockMerchant has the following parameter(s): int n: the number of socks in the pile int ar[n]: the colors of each sock Returns int: the number of pairs Input Format The first line contains an integer , the number of socks represented in .The second line contains space-separated integers, , the colors of the socks in the pile. Constraints where Sample Input STDIN Function ----- -------- 9 n = 9 10 20 20 10 10 30 50 10 20 ar = [10, 20, 20, 10, 10, 30, 50, 10, 20] Sample Output 3
- in javascript please create a function that does the following and is named as such please don't copy and paste the incorrect answer sequence( start, step ) This function takes two numeric inputs, start and step, and returns a function of no inputs. The ith invocation of the resulting function will generate the value: start + step * i. The first invocation is said to be the 0th. Examples var x = sequence( 3, 15 ) [ x(), x(), x() ] => [ 3, 18, 33 ] var y = sequence( 28, -5 ) [ y(), y(), y() ] => [ 28, 23, 18 ]solve in assembley language, MIPS Square Root Calculation: Newton’s iterative method can be used to approximate the square rootof a number x. Let the initial guess be 1. Then each new guess can be computed as follows:guess = ((x/guess) + guess) / 2; Write a function called square_root that receives a double-precision parameter x, computes,and returns the approximated value of the square root of x. Write a loop that repeats 20 timesand computes 20 guess values, then returns the final guess after 20 iterations. Use the MIPSfloating-point register convention (Section 9.6) to pass the parameter x and to return thefunction result. All computation should be done using double-precision floating-pointinstructions and registers. Compare the result of the sqrt.d instruction against the result ofyour square_root function. What is the error in absolute value?Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline. Remember that print() automatically adds a newline.Sample output with input: 742 seconds ''' Your solution goes here ''' user_ounces = int(input())print_popcorn_time(user_ounces)
- 3. Find Relatively Prime Write a function to return a number that is relatively prime with the given number. /* return an integer that is relatively prime with n, and greater than 1i.e., the gcd of the returned int and n is 1 Note: Although gcd(n,n-1)=1, we don't want to return n-1*/int RelativelyPrime (int n) 4. Find Inverse Then implement the following function, which returns the inverse modulo, and test it.Note that you need to check whether a and n are relative prime before calling thisfunction. Recall that a and n are relatively prime means that gcd(a,n)=1, i.e., theirgreatest common divisor is 1. Also recall that the extended Euclidean Algorithm canfind the integer s and t for a and n such that as+nt=gcd(a,n), where s is the inverseof a modulo n. /* n>1, a is nonnegative *//* a<=n *//* a and n are relative prime to each other *//* return s such that a*s mod n is 1 */int inverse (int a, int n){int s, t;int d = ExtednedEuclidAlgGCD (n, a, s, t);if (d==1){return (mod (t,…***in python only*** use turtle function Define the concentricCircles function such that: It draws a series of concentric circles, where the first parameter specifies the radius of the outermost circle, and the second parameter specifies the number of circles to draw. The third and fourth parameters specify an outer color and an other color, respectively. The outer color is used for the largest (i.e., outermost) circle, and then every other circle out to the edge alternates between that color and the 'other' color. The difference between the radii of subsequent circles is always the same, and this difference is also equal to the radius of the smallest circle. Put another way: the distance between the inside and outside of each ring is the same. Define concentricCircles with 4 parameters Use def to define concentricCircles with 4 parameters Use any kind of loop Within the definition of concentricCircles with 4 parameters, use any kind of loop in at least one place. Call…Transcribed Image Text About initial programming in python: Consider the series: 8. 1)" 1 = 1- 3 1 1 1 2n | 1 n=0 whose sum converges ton/4 That is: П lim s, = a) Write a function that, given n, calculates the sum of the series up to term n. b) Write a function that calculates the sum of the series with an error of less than O.01, that is, calculate the sum of the series series such that |Sn-N/4| < O. 01. Your function must also return the number of terms necessary to reach this error, that is, your function will return a tuple with the two calculated values. Important: It is mandatory to use the function defined in the previous item. Hint: math.fabs(number) returns the absolute value (module) of a number.