Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92783532
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

The of the steering wheel is used to create a parallel

The _____ of the steering wheel is used to create a parallel plane in the Synchronous Part environment. The _____ option is used to apply the crown by defining its radius and take-off angle. 1-In the Ordered Part environ ...

Please do it in c programrevisit the matrix addition

Please do it in C program Revisit the matrix addition function Write the program so that it would not need to take a third pointer for the result matrix Instead, have the function return a pointer to the results matrix P ...

Construct a frequency distribution for the number of

Construct a frequency distribution for the number of different residences occu-pied by graduating seniors during their college career, namely 1, 4, 2, 3, 3, 1, 6, 7, 4, 3, 3, 9, 2, 4, 2, 2, 3, 2, 3, 4, 4, 2, 3, 3, 5

In terms of reducing the total number of memory accesses a

In terms of reducing the total number of memory accesses a program might require. Using the arithmetic expression S = (A+B)-(C+D), support this statement.

What is the concentration of total nitrogen in 15 mg nh3l 3

What is the concentration of total nitrogen in 15 mg NH3/L, 3 mg NO2-/L and 13 mg NO3-/L in mg/L, moles/L, ppm and ppb?

Question classyou need to research the topic and discuss

Question: Class, You need to research the topic and discuss the topic in at 500 words with references. Then, reference will not count as a discussion. Question: What would be the impact of predictive modeling on healthca ...

Assessment - managing services and securitytask - in this

Assessment - Managing Services and Security Task - In This Assignment your job is to create two Virtual machines each running a different but the latest distribution of Linux e.g. Ubuntu Server and CentOS. Each of these ...

What is 4g and its benefits how fast is your internet

What is 4G and its benefits. How fast is your Internet service supposed to be for stationary users?

Suppose a machine has 16 registers and uses 24 bit memory

Suppose a machine has 16 registers and uses 24 bit memory addresses. The opcodes are 8 bits so that the instruction length is 32 bits. Register instructions can have two or three register operands (4 bits to name each re ...

Question a suppose you do shading calculations in the

Question : a) Suppose you do shading calculations in the vertex shader. What happens to the vertex colors when they go from the vertex shader to the fragmant shader? b) Suppose instead you want to do the shading calculat ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As