Highest relative frequency of letters

Assignment Help Basic Computer Science
Reference no: EM131947386

Question:

Please help with this python 3 programming question: 

Using the function max_relative_frequency(s) which takes as argument a string and returns the highest relative frequency of any letter in the string. This value is unique. There can be several letters that occur with an equal (highest) frequency, but in that case their relative frequency is the same.

  • Consider only letters of the English alphabet (that is, 'a' through 'z').
  • For the purpose of counting occurrances, consider letters that differ only by case to be the same letter. For example, the letter 'n' occurs three times in the string "Non-even" (once in upper case, twice in lower case).
  • For the purpose of counting the total number of letters in the string, count only letters. For example, the string '0 << c++ << 9' contains only one letter, 'c', so the relative frequency of 'c' in this string is 1.
  • If the string contains no letter, the relative frequency is undefined and your function should return 0.

Examples:

  • The string 'sufficit' has 8 letters, and the most frequent letters are f and i, which both occur twice. Thus, the highest relative frequency is 2/8.
  • The string 'Non-even' has 7 letters (- is not a letter), and the most frequent letter is n which occurs three times (one N and two n). Thus, the highest relative frequency is 3/7.

Therefore, the answers for maximum relative frequency which returns the highest relative frequency of letters in a string must be a fraction, or decimal and between 0 and 1

I also do not understand how to work out the length of the string if you only have to count letters

Reference no: EM131947386

Questions Cloud

Features of group policy provided by windows server : 1. What are the features of Group Policy provided by Windows Server 2012 R2? What are the 3 new features in 2012 R2 is important?
Discuss some of the legislative actions : Discuss some of the legislative actions that have impacted upon law enforcement concerning recruiting and/or hiring.
Monitor using the tool : If you used a file-integrity tool such as OSSEC on your home computer, what folders would be most appropriate to monitor using the tool? Why?
Define the types of ethical issues : Describe the types of ethical issues that could arise during training evaluation processes and identify actions that can be taken to address and overcome.
Highest relative frequency of letters : Therefore, the answers for maximum relative frequency which returns the highest relative frequency of letters in a string must be a fraction
What should be the selling price of the bond : A zero coupon bond has a face value of $1,000 and matures in 6 years. What should be the selling price of the bond?
Howard is willing to pay for the bond investment proposed : Indicate the maximum price that Howard is willing to pay for the bond investment proposed by Stanley?
Why was your chosen financial event newsworthy : An example can be articles on landing a large contract, reporting unusual profits or losses, expressing concern for future profitability, etc.
Efficiency of replications within network : Question: What can you do to improve the efficiency of replications within your network?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Appearance of a document

What do you call the word processing task associated with changing the appearance of a document?

  Explaining process of making changes as recursive

You can view the process of making changes as recursive. You first see if any dollars are required, subtract them from the total, and then make change for what remains. Complete the LISP program to achieve the above requirements.

  Show that the roots can be found in o(log n) steps

Consider an n-vertex directed graph in which each vertex knows the address of its parent and the roots have themselves as parents. Under the assumption that each vertex is placed in a unique cell in a common PRAM memory, show that the roots can be..

  Standard command to determine the pathname

What is the standard command to determine the pathname/location of the mv command/program?

  Research new network observation tools

Research new network observation tools that use enhanced techniques, such as virtual machine-based code execution, to detect unwanted network traffic (e.g., botnet activity or malware activity that is not detectable by traditional Anti-virus techniqu..

  Costs of the organization bi initiatives

Identify 2 specific benefits that the organization receives from its use of business intelligence (BI). Contrast the value of these benefits against the costs of the organization's BI initiatives.

  Administration because it sounded interesting

John is thinking of going to college to get a degree in Network administration because it sounded interesting.

  Determine your dhcp lease strategy

Discuss the factors that would determine your DHCP lease strategy. Include where you would position your servers and what factors would drive your lease length.

  How do you pass values by value and by reference

How do you pass values by value and by reference? What are the differences between these two approaches

  Write the definition of a class player containing

Write the definition of a class Player containing: An instance variable name of type String , initialized to the empty String. An instance variable score of type int , initialized to zero.

  Find the two-level minimized sum-of-products forms

Briefly compare the implementation complexities in terms of gates and literals. For each function, which achieves the "simplest" implementation.

  Find the transmitted code if the frame is msb

Find the transmitted code if the frame is (MSB) 1101011011 (LSB) and generator polynomial is x4 + x + 1.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd