0

I have provided many submissions and all of them have been wrong. Not sure what else I can do so I am asking here.

Give a formula that computes the number of operations required to find the average of any amount of numbers (Use variable n to represent the amount of numbers in the list)

For some reason I get lost when trying to figure this out...and it seems like it should be so basic!

  • Start with two numbers. How many operations do you need? Now try three numbers and then four. Do you see a pattern? – John Douma Oct 28 '18 at 20:15
  • Thanks for the reply! I understand how to get it, I can't phrase it mathematically. I have n=Length[{A1,A2…An}] - 1 but he says that makes no sense in math, so I am guessing I am using some for of code or psuedo code. I know that the # of operations is equal to 1 less than the total number of objects...or I think – Christopher M Oct 28 '18 at 20:21
  • Don't forget the division. – John Douma Oct 28 '18 at 20:34
  • Yeah, I noticed that but my issue is still how do mathematically represent a number of items in a list. I appreciate your help! But he still says that the n=[{]} makes no sense in a math sense so I am lost as to how to represent a number of items in a formula that is acceptable...this is what he replied with – Christopher M Oct 28 '18 at 20:36
  • The notation [{A1,A2…An}] does not make sense in a mathematical explanation. What you really need is a "number", or something that gives you a number. A formula that uses n, which is the number of elements you are using in general. Using n on the left side means that you want to count something else that will give the number of elements, but that's something you already have. – Christopher M Oct 28 '18 at 20:38
  • Imagine you have three elements, and you have to determine the number operations. You could say something like "Number of operations = 3+2+1", so you use the number of operations in the formula. You cannot say "3 = number of operations + 1", or something like that. – Christopher M Oct 28 '18 at 20:38
  • What you have to do is to find a formula, that includes n, that gives you the total number of operations. It should look more like "O = n+n+n+...+1+2+3+...", where O means "number of operations" and n means "number of elements used, in general". – Christopher M Oct 28 '18 at 20:39
  • I don't understand your difficulty. There are two kinds of operations, addition and division. Take the number of each and add them. – John Douma Oct 28 '18 at 20:42
  • Again, thanks for your time and patience! Ok, I need to know how to get the total # of numbers from the list in mathematical formula. I know how to get averages, I can add myself how to get operations. I don't understand how it looks in a math formula though. His answers make no sense to me either. It might be a snake an biting me but I am blind at the moment. Give me C# code we are good! But in a non programmer way? forget it! – Christopher M Oct 28 '18 at 20:47
  • return myList.Count; – John Douma Oct 29 '18 at 03:30
  • I tried similar but he wants an algebraic equation, not a code or pseudo code. So i I was thing why not simply n=(1+1+...+1n) so if n=3 then 1+1+1=3 there are 3 operations to get the average (1+1+1)/3 – Christopher M Oct 29 '18 at 04:11
  • Have you tried $n$? – John Douma Oct 29 '18 at 04:32

0 Answers0