09-26-2013 12:17 PM
Alt is our guiding light. 😉
09-26-2013 12:31 PM - edited 09-26-2013 12:49 PM
excluding the 'zero'....
09-26-2013 12:40 PM
@apok wrote:
@RavensFan wrote:
SpoilerCreate the array. Use quotient remainder to divide by 2. Now you have an array where all the odd numbers are now 1, and all the even numbers are now 0. Sum the array and you have the total number of odd numbers. The number of evens will be the length of the array divided by the # of odds.
"The number of evens will be the length of the array divided by the # of odds."......you mean subtracted not divided?
Yes. I think I had divided still on my mind from talking about the Q&R function.
09-26-2013 12:41 PM
@apok wrote:
excluding the 'zero'....
Why are you excluding zero? It is an even number also.
09-26-2013 12:48 PM
@apok wrote:
excluding the 'zero'....
The original problem deals with random number is the range of 0 to 20, thus zero should not be excluded. If zero should not occur, the random generator needs to be changed to generate numbers from 1..20.
09-26-2013 12:49 PM - edited 09-26-2013 12:56 PM
09-26-2013 01:03 PM - edited 09-26-2013 01:03 PM
As has been said, zero is an even number, so I would suggest not to escalate the issues by adding complications that are not requested.
Here's all that's needed. (I included the random generator, because many users take shortcuts that give lower probabilities for the first and last element.)
09-26-2013 01:26 PM - edited 09-26-2013 01:38 PM
@altenbach wrote:
As has been said, zero is an even number, so I would suggest not to escalate the issues by adding complications that are not requested.
Here's all that's needed. (I included the random generator, because many users take shortcuts that give lower probabilities for the first and last element.)
sorry for the mis-direction on my part,"excluding zero".....
09-27-2013 03:21 AM
Thank you very much!
This is exactly what I need, I can´t thank you enough.
09-27-2013 03:24 AM
Thank you for your help