Solved

Finding an array of averages ?? Newbie here

Posted on 2013-06-24
2
243 Views
Last Modified: 2013-07-02
I am writing a program that a decision needs to be made, and I need help with.

I have a range of numbers ( actually ASCII values ) from:

97 to 122 ( representing a-z )

The user will be entering six (6) letters as an answer.

Somehow, I need SIX branches of decisions to be made based upon the sum of their answer.

Here is my pseudocode ( remember I need 6 branches ) - and my pseudocode will be using low, wrong numbers just for example:

if answer>100 and answer < 200)
   DO THIS, BRANCH #1

if answer >200 and answer<300
   DO THIS, BRANCH #2

etc.

I dont know how to take the six characters entered ( adding up their AsCII values ) and determine how to break it up into six branches! I would like the branches to be equal in their span, but they don't have to be.

Can someone help me in determining the six branchevalues???

Thank you.
0
Comment
Question by:edvinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 250 total points
ID: 39270793
If you are adding together 6 numbers from 97 to 122, the smallest possible sum would be
97+97+97+97+97+97=582
the largest possible sum would be
122+122+122+122+122+122=732
the difference, 732-582 =150 (for 151 distinct possible sums)
dividing that into 6 approximately equal spans 150/6=25
(but there will be more ways of generating sums in the middle spans than in the end spans)
0
 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 250 total points
ID: 39271139
If you want an equal number of possibilities (well, there's some rounding) in each bucket, then the buckets should be split as follows:
582-639
640-649
650-657
658-665
666-675
676-732

I attached the spreadsheet where I made the calculations for reference.
Permutations.xls
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Win a Jar of Candy Corn: A Scientific Approach! I love mathematics. If you love mathematics also, you may enjoy this tip on how to use math to win your own jar of candy corn and to impress your friends. As I said, I love math, but I gu…
Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question