Program - Python Implement a function called zeros_and_ones() that takes a list s as argument and returns the number of zeros and ones in a dictionary d. s = [1,0,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,1,1] Hint: Your program should output {0: 11, 1: 14}
Q: Why is understanding how operating systems interact with computers so important?
A: Introduction How operating systems interact with machines is the topic of this inquiry.
Q: Enlist different types of charts in MS-Excel and explain any one in detail
A: In this question we need to enlist different types of charts used in MS-Excel. We also need to…
Q: Troubleshooting X Windows issues may be done using the lspci command. Which one of these statements…
A: The Linux programme lspci (list PCI) gives details about each PCI bus on your system. This contains…
Q: We suggest adding a new category to Flynn's taxonomy. What sets advanced computers apart from their…
A: Flynn's taxonomy : Flynn's taxonomy is a classification system for computer architectures developed…
Q: 4) If L is a recursively enumerable (RE) language, then the strings in L can be accepted by a: 5) If…
A: Despite being recursively enumerable, all languages are accepted by the Turing computer. Enumerable…
Q: How clear-cut is it to separate hardware from software?
A: Computer hardware refers to the physical components of a computer, such as a case, central…
Q: What are the two sorts of services provided by the Internet to its users? What are some of the…
A: The two categories of services the internet offers to its application are: The Internet offers its…
Q: How can inline style sheets override the style of an HTML document?
A: You must place embedded styles in the HTML document, while you must place embedded stylesheets in…
Q: What are the five most noteworthy computer graphics applications in today's corporate world?
A: GIVEN: What are the five most common ways that computer graphics are used? Here are five examples of…
Q: A left rotation operation on an array of size shifts each of the array's elements unit to the…
A: The answer to the following question:-
Q: What are the five most notable applications of computer graphics in today's business world?
A: I was given: Which five fields are considered to be the most significant applications of computer…
Q: What are the key features of graphics and media apps like computer-aided design, desktop publishing,…
A: Different software and its uses: People also utilize software created especially for their line of…
Q: It is important to have a thorough discussion of the new scalability-oriented clou computing…
A: Cloud Computing Cloud Computing resources and computing power are made available through distributed…
Q: In other words, computer science is the academic discipline concerned with learning about and…
A: Introduction: The verb "to calculate" is the root of the term "computer," which meaning "to…
Q: Provide an explanation of the hosting infrastructure used by cloud-based services and applications.
A: Cloud hosting is all about making services, websites, and apps more accessible by using the…
Q: The role that the Internet of Things plays in the development of "smart" homes. Give some examples.
A: A home may be bright if it is equipped with a number of intelligent devices that can be remotely…
Q: When it comes to cloud computing, what are the pros and cons of having users all over the globe…
A: This is the solution. The Internet, data storage, and even software are being used by companies and…
Q: What do you make of the worldwide adoption of the internet and its seemingly endless rate of growth?
A: Let's check out the answer. More than 3.4 billion people used the internet in the globe in 2016, up…
Q: How does quality assurance argue for the automation of items utilizing e-commerce domain native…
A: We need to talk about the QA advocate automating items from a domain in native Android and iOS with…
Q: Explain how the notions of dependability and availability are related using a computer network as an…
A: Introduction The expression "reliability" alludes to a computer's capacity to execute as per its…
Q: To what extent do the SPEC CPU benchmarks remedy the problems encountered in the Whetstone,…
A: SPEC CPU benchmark addresses the shortcomings of the Dhrystone, Whetstone, and Linpack benchmarks:…
Q: Engineers often have training in the basics of computer code writing. Sometimes engineers acquire…
A: Introduction: While computer engineers usually work as programmers, computer scientists are…
Q: Can you name the three broad types of procedural languages that exist? You should explain each in a…
A: There is no concept of class in procedural programming. It is possible to create a procedural…
Q: Is there any component of a personal computer that, although maybe not crucial, must be included?
A: Introduction: Hardware and software make up a computer system's two parts. They both rely on one…
Q: Describe the various safeguards in MS-Excel and how they work. Give reasons and instances to back up…
A: Types: The following protection types are available in MS-Excel to safeguard data: Record Level.…
Q: 1) Give a Turing machine that recognizes the language L = {ai b³ ck | i≤j≤ k} .
A: Here we will see how to construct a Turing machine for the language. So this represents a kind of…
Q: Just what does it entail to be considered "peripheral?"
A: A computer peripheral is any external device that connects to a computer and offers input and…
Q: Assume that your database management system has failed. Explain the use of deferred-write and…
A: The answer to the question is given below:
Q: Convert the infix expression to postfix expression by using the algorithm in the book. You MUST show…
A: - We need to get the postfix expression for the provided expression.
Q: The advantages of cloud computing are many, but what are some of the more notable ones? Is cloud…
A: Which command gives your computer's hop count? Tracert monitors FTP websites or paths. This command…
Q: Is there any component of a personal computer that, although maybe not crucial, must be included?
A: Computer hardware and software Hardware and software make up a computer, a digital device. A…
Q: What characteristics should you seek for in a newly released printer firmware?
A: In this question we need to explain various characteristics which we should seek for in a newly…
Q: The internet and other types of information technology have contributed to the widening of the…
A: The discrepancy in access to information technology across different demographic groups is known as…
Q: The content creation industry is not immune to the rise of independent networks. Explain Google's…
A: Introduction: The areas where AdWords adverts are shown are referred to as "Google's network."
Q: Transform the grammar with productions Chomsky normal form. S→ abAB A → baB|X B→BAA|A|A into
A: Please refer to the following step for the complete solution to the problem above.
Q: To provide just one example, if you plan on starting a media firm and need individuals with certain…
A: Given: Data that is presently in use is duplicated on a backup storage device. A backup storage…
Q: Troubleshooting X Windows issues may be done using the lspci command. Which one of these statements…
A: Answer The given statement is False
Q: Is there a command that would tell you how many computers stand between yours and another?
A: A command-line interface is defined as. It is common practise to utilise a text-based user interface…
Q: What are the two major visual distinctions between the constructor and the class's methods
A: Constructors; Constructors are answerable for instating objects, despite the fact that they produce…
Q: When it comes to disk scheduling, how risky is it to employ the SSTF algorithm?
A: The disc scheduling method known as SSTF (Shortest Seek Time First) chooses the request that is…
Q: You must discuss how tough it is to design user interfaces with a software team that will implement…
A: Given Why are user interfaces difficult to build, please? There are five tasks to execute a user…
Q: please help me creating a ERD-diagram for the following cafe website and ordering Database design:…
A: It is easy for the developers to understand the system by simply looking at the ER diagrams.
Q: Which states are equivalent? Inputs: None; Outputs: z z = 1 No equivalent states s, t, u S, U z=1 s,…
A: Answer: Assume that M = (Q,Σ, δ, q0,F) is a DFA. If, for every string x, the state that M reaches…
Q: Fail-open configuration for Whitelisting (Network Security)
A: A whitelist (allow list) which it is a cybersecurity strategy that approves a list of email…
Q: Thoughts about the upsides and downs of becoming global in the cloud computing setting.
A: Introduction: With the use of this technology, businesses may provide their clients compute services…
Q: What exactly is cloud computing, and what does it imply?
A: Answer: Internet of Things: Instead of the programme operating on local computing devices like…
Q: Suppose that first and last names are two arguments. Write a function initials_switch. You can send…
A: Since the programming language is not mentioned, I have done the code using Python 3.
Q: In this part, we'll discuss the ways in which cloud infrastructures support the hosting of network…
A: Cloud hosting which makes applications and the websites accessible using cloud resources. Unlike…
Q: There are many distinct methods in which information may be generated and processed by a computer…
A: Definition: Instructions are used to direct the central processing unit while it runs the…
Q: When it comes to cloud computing, what are the pros and cons of having users all over the globe…
A: The cloud has changed how organisations and people use Internet, data storage, and software. This…
Program - Python
Implement a function called zeros_and_ones() that takes a list s as argument and returns the number of zeros and ones in a dictionary d.
s = [1,0,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,1,1]
Hint:
Your program should output {0: 11, 1: 14}
Step by step
Solved in 4 steps with 2 images
- 1- Programming Problem Part 1 Write a function that will have a list as an input, the task of the function is to check if all the elements in the list are unique,( i.e. no repetition of any value has occurred in the list), then the function returns true otherwise it returns false. Your program should include a main method that call the method to test it. (If you would use built-in functions in Python, use lists’ or dictionaries’ methods as we studied their time efficiency in class)#### Part 1 Write a Python function (`binary_search`) that implements the binary search algorithm. This function will take a list argument (`values`), a value to search for (`to_find`), a start index (`start_index`), and an end index (`end_index`). The function will return `True` if `to_find` is present in `values`, and `False` otherwise. Below, you will find some code to test your binary search: ```python values = [2,4,6,8,10,12,14,16,18,20] print(binary_search(values, 14, 0, len(values) - 1)) print(binary_search(values, 7, 0, len(values) - 1)) ``` The output of the test code is below: ``` True False ``` #### Part 2 Modify your `binary_search` function to count the number of comparisons (==, <, <=, >, or >=). The function will now return both the number of comparisons made and the `True` or `False` result. The code below calls your function, and creates a simple ASCII bar chart of the number of comparisons (divided by 10, to account for small differences). Some…Write a function that returns the greatest common divisor (GCD) of integers in a list. Use the following function header:def gcd(numbers):Write a test program that prompts the user to enter five numbers, invokes the function to find the GCD of these numbers, and displays the GCD.
- Dictionary Swap Write a function called dictionary_swap that takes a dictionary as a parameter. It does not modify the original dictionary, but it creates and returns a new one. Keys from the original dictionary become values in the new one, and values become keys. For example, given the inputs below, your program should return the corresponding values. Input to the Function Returns {'one':1, 'two': 2, 'three':3} {1:'one', 2:'two', 3:'three'} {-1:-10, -2:-20, -3:-30} {-10:-1, -20:-2, -30:-3} {} {}***python only*** Write a function votes_by_race() which takes a list of dicts as a parameter and returns a dict. For example, given the following list: votes = [{'for': 'A, 'age': 35, 'race': 'w'}, {'for': 'B', 'age': 40, 'race': 'b'}, {'for': 'B', 'age': 20, 'race': 'b'}, {'for': 'A', 'age': 30, 'race': 'a'}, {'for': 'A', 'age': 41, 'race': 'w'}, ] The call votes_by_race(votes) should return the following dict:{"White": 2, 'Black': 2, 'Asian': 1, "Hispanic': 0}two_sum is a Python function that takes in a list of integers (elements) and an integer number (num) and returns True if there exist two values in elements that add up to num, otherwise, function returns False. def two_sum(elements: List[int], num: int): for i in range(len(elements)): for j in range(i + 1): if elements[i] + elements[j] == num: return True return False Study above function and answer below questions: A. What is time complexity of two_sum? B. Is it possible to improve on above algorithm performance (in terms of its asymptotic cost)? If yes, describe your algorithm, be detailed as much as possible.
- Exercise, maxCylinderVolume F# system function such as min or methods in the list module such as List.map are not allowed Write a function maxCylinderVolume that takes a list of floating-point tuples that represent dimensions of a cylinder and returns the volume of the cylinder that has the largest volume. Each tuple has two floating point values that are both greater than zero. The first value is the radius r and the second value is the height h. The volume of the cylinder is computed using ??2h. The value π is represented in F# with System.Math.PI. If the list is empty, return 0.0. Examples: > maxCylinderVolume [(2.1, 3.4); (4.7, 2.8); (0.9, 6.1); (3.2, 5.4)];;val it : float = 194.3137888> maxCylinderVolume [(0.33, 0.66)];;val it : float = 0.2257988304#### Part 1 Write a Python function (`insertion_sort`) that implements the insertion sort algorithm, discussed in the lectures. This function will take exactly one list argument, and will return a list. The argument (`values`) is a list of integers to be sorted. You will return a new list which has been sorted in ascending order. Below, you will find some code to test your insertion sort: ```python unsorted = [4,3,7,1,8,2] sorted = insertion_sort(unsorted) print(sorted) ``` #### Part 2 Modify your `insertion_sort` function to count the number of comparisons (==, <, <=, >, or >=). The function will now return both the number of comparisons made and the sorted list (in that order). _**Note:** For simplicity, since counting these comparisons won't improve the accuracy of your count very much, we'll ignore the comparisons made in the final iteration of the loop. One or both of these comparisons may actually be made, so determining the exact number of comparisons would be…Write a python code 2) Write a function listsort which accepts a list as a parameter, and sorts it in ascending order. You can use any standard sorting algorithm, but don’t use built-in sort methods and functions. The function must sort and return the list.
- Remove Char This function will be given a list of strings and a character. You must remove all occurrences of the character from each string in the list. The function should return the list of strings with the character removed. Signature: public static ArrayList<String> removeChar(String pattern, ArrayList<String> list) Example:list: ['adndj', 'adjdlaa', 'aa', 'djoe']pattern: a Output: ['dndj', 'djdl', '', 'djoe']PYTHON CS1 PROBLEM Define a function that takes a list of lists, glol, as a parameter. You may assume that the inner lists in glol are lists of positive integers. Your function should return True if at least one of the inner lists in glol contains two or more multiples of 10. Otherwise it should return False. For example: If glol = [ ] then your function returns False. If glol = [[ ], [4, 2]] then your function returns False. If glol = [[10, 2, 6, 8], [12, 6], [15, 20, 5]] then your function returns False. If glol = [[10, 2, 6], [12, 6], [10, 2, 70, 15], [15, 10, 5]] then your function returns True as the inner list [10, 2, 70, 15] contains 10 and 70. If glol = [[10, 2, 6], [12, 6], [10, 7, 15], [50, 10, 50, 4, 6]] then your function returns True as the inner list [50, 10, 50, 4, 6] contains 50 twice. 6. If glol = [[10, 20, 6, 90], [12, 6], [ 7, 3, 15], [50, 10, 50, 4, 7]] then your function returns True as the inner lists [50, 10, 50, 4, 7] and [10, 20, 6, 90] contain more…a- Write a Python function Salary_levels, that takes a list as an argument and returns the number of the high salaries (salary>=5000), the average salaries(1000<=salary<5000, and the low salaries (salary<1000). You can use the following list : salaries= [500,1070,1450,6500,9000,940,450,400,600,2750,1100,8400,1500,900,1200] b- Use the above function to print the counts of the high, average, and low salaries. N.B: the codes of parts a and b should be included in your answer.