Letters of the english alphabet

Assignment Help Basic Computer Science
Reference no: EM131943423

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: EM131943423

Questions Cloud

What are the features of group policy : What are the features of Group Policy provided by Windows Server 2012 R2? Whayt are the 3 new features in 2012 R2 is important?
Identify opportunities for alliances with other agencies : Identify opportunities for alliances with other agencies or organizations. State why the alliances are important.
Debt affect the weighted average cost of capital : How do increases in debt affect the weighted average cost of capital?
File-integrity tool such as ossec on home computer : 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?
Letters of the english alphabet : Consider only letters of the English alphabet (that is, 'a' through 'z').
Determine the overall project budget and plan : Define the scope: Determine what the project objective will be, and define the scope of the project.
How two or more anthropologists approach a similar research : You will be asked to compare, contrast, or integrate how two or more anthropologists approach a similar research topic.
What is interesting or helpful about the view : What's interesting or helpful about this view? What would I notice if I believed this view? In what sense or under what conditions might this idea be true?"
What is your net cash position after selling : Five years later you sell for $5,000, and you must pay off the remaining loan balance when sold. What is your net cash position after selling?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What percentage of variation is explained by the processor

Is there a significant (at 90% confidence) difference between any two processors?

  Diagram of the finite automaton

Determine the DFA that will accept those words from Σ = {a b , } where the number of b's is divisible by three. Sketch the state table diagram of the finite Automaton M also.

  Copyright and other privacy policies along with navigations

Create a simple static website. Your website should have the following requirements Requirements: Create a master page Your website should have minimum of 5 different pages Your website should include a form that will register the users.

  Price of a share of company miami stock

Company Miami just paid annual dividend of $25 today. The dividend is expected to grow at 5% for the next 3 years, then it will grow at 3% in perpetuity.

  Estimating the component cost of equity

Under what situations would you want to use the CAPM approach for estimating the component cost of equity? The constant-growth model?

  Six economic goals discussed in section

Review the six economic goals discussed in this section. Then, in a paragraph of at least five sentences, describe the goal you feel is the most important to a country and explain why you feel this way. Be sure to provide at least two logical reas..

  Multiple sources and integrate it into a cohesive paper

You will need to make sure to identify the appropriate research question, identify key terms for performing electronic searches, organize your data, obtain data or information from multiple sources and integrate it into a cohesive paper.

  Did the designs allow one to extract data into relevant info

Did the designs allow one to extract data into relevant informational views?Can the DBMS aide in making real time intelligent decisions?Can it aide in closing the loop from decision into action?

  Describe role of hardware components and operating software

Write a 1,050-word paper describing the role of hardware components and operating system software on a computer.

  Build a sorted double-linked list such

For example, you build a list of characters, then you can print it out as: "a b c d e" or "e d c b a". The input is of an random character list is from the keyboard.

  Dramatic increase in international trade

What might account for the dramatic increase in international trade over the past 50 years?

  What is difference between the memory bus and the pci bus

What is the difference between the memory bus and the PCI bus? Most 32-bit buses permit 16-bit reads and writes. Is there any ambiguity about where to place the data? Discuss.

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