Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 762
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

Ali -

Tushar Mehta describes two methods with references to others:

http://www.tushar-mehta.com/excel/te...ues/index.html

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel



"" wrote in message
...
1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 690
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

Ali wrote:
1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50



The sum of 5 Odd numbers is Odd also, so I don't believe there is a
solution as stated that equals an even number (ie 50)

- - -
HTH
Dana DeLouis

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

1+3+5+7+15+19
--
Gary''s Student - gsnu200815
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

On Nov 22, 4:24*am, Dana DeLouis wrote:
Ali wrote:
1+3+5+7+9+11+13+15+17+19=100 *
Choose 5 numbers from these 10 figures so there sum is = 50


The sum of 5 Odd numbers is Odd also, so I don't
believe there is a solution as stated that equals
an even number (ie 50)


Why use well-founded reasoning when brute force will do the trick?

Just kidding. But the following might be a useful paradigm for
solving such problems when the answer is not so obvious.


Sub doit()
x = Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)
For i1 = 0 To UBound(x) - 4
For i2 = i1 + 1 To UBound(x) - 3
For i3 = i2 + 1 To UBound(x) - 2
For i4 = i3 + 1 To UBound(x) - 1
For i5 = i4 + 1 To UBound(x)
Sum = x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
If Sum = 50 Then Debug.Print Sum; x(i1); x(i2); x(i3); x(i4); x(i5)
Next i5: Next i4: Next i3: Next i2: Next i1
End Sub


PS: Lots of solutions when choosing 6. I wonder if the OP simply
mistyped.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

That looks like 6 numbers to me.<g

See Dana's post as to why the problem as asked can't be solved.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
1+3+5+7+15+19
--
Gary''s Student - gsnu200815


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

??? The OP's initial post said "Choose 5 numbers from these 10 figures so
there sum is = 50" (where he misspelled "their")... how do you read that as
allowing more than 5 numbers? I read it, to paraphrase, as this... Choose 5
number such that their sum equals 50"

--
Rick (MVP - Excel)


"rebel" wrote in message
...
On Sat, 22 Nov 2008 16:05:07 -0500, "Rick Rothstein"
wrote:

That looks like 6 numbers to me.<g


but the "conditions" didn't say *only* five. It just required use of
five,
which the poster has complied with.

See Dana's post as to why the problem as asked can't be solved.


That was my initial response, but GS's solution appears to be compliant.


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

On Sat, 22 Nov 2008 16:05:07 -0500, "Rick Rothstein"
wrote:

That looks like 6 numbers to me.<g


but the "conditions" didn't say *only* five. It just required use of five,
which the poster has complied with.

See Dana's post as to why the problem as asked can't be solved.


That was my initial response, but GS's solution appears to be compliant.
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

A clear demonstration that just because a person can add does not mean they
can count.
--
Gary''s Student - gsnu200815


"Rick Rothstein" wrote:

That looks like 6 numbers to me.<g

See Dana's post as to why the problem as asked can't be solved.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
1+3+5+7+15+19
--
Gary''s Student - gsnu200815



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

joeu2004 wrote:
On Nov 22, 4:24 am, Dana DeLouis wrote:
Ali wrote:
1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50

The sum of 5 Odd numbers is Odd also, so I don't
believe there is a solution as stated that equals
an even number (ie 50)


Why use well-founded reasoning when brute force will do the trick?

Just kidding. But the following might be a useful paradigm for
solving such problems when the answer is not so obvious.


Sub doit()
x = Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)
For i1 = 0 To UBound(x) - 4
For i2 = i1 + 1 To UBound(x) - 3
For i3 = i2 + 1 To UBound(x) - 2
For i4 = i3 + 1 To UBound(x) - 1
For i5 = i4 + 1 To UBound(x)
Sum = x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
If Sum = 50 Then Debug.Print Sum; x(i1); x(i2); x(i3); x(i4); x(i5)
Next i5: Next i4: Next i3: Next i2: Next i1
End Sub


PS: Lots of solutions when choosing 6. I wonder if the OP simply
mistyped.


How cool!

Has anyone noticed that plotting x = Sum v. y = count of combinations
making Sum resembles a normal distribution? (Is it?)

Ok, perhaps that is not so fascinating, but try this:

Make x() an array of Fibonacci numbers and try the plot again. A
fractal-like pattern emerges. Evaluate the following for Test in
(0..4000) to appreciate.

'
Code:
Public Function doit(Test As Long) As Long
On Error GoTo ErrBreak

Dim x(41) As Long
Dim i1 As Long
Dim i2 As Long
Dim i3 As Long
Dim i4 As Long
Dim i5 As Long
Dim Sum As Long
Dim R As Long

' set up Fibonacci sequence
x(0) = 0
x(1) = 1
For i1 = 2 To 41
     x(i1) = x(i1 - 2) + x(i1 - 1)
Next i1

For i1 = 0 To UBound(x) - 4
For i2 = i1 + 1 To UBound(x) - 3
For i3 = i2 + 1 To UBound(x) - 2
For i4 = i3 + 1 To UBound(x) - 1
For i5 = i4 + 1 To UBound(x)
     Sum = x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
     If Sum = Test Then
         R = R + 1
     End If
Next i5: Next i4: Next i3: Next i2:
Debug.Print Test & "." & i1
Next i1
doit = R
Exit Function
ErrBreak: Stop
Resume Next
End Function
'


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

I got more chuckles off this post, than any in a long time!

Next we should square the circle, and trisect the angle with compus and ruler.

1+3+5+7+9+11+13+15+17+19=100

=SUM(100/(9-5-3+1)) = 50

A Mensa quiz!

Some laughs,
Shane Devenshire



"Gary''s Student" wrote:

A clear demonstration that just because a person can add does not mean they
can count.
--
Gary''s Student - gsnu200815


"Rick Rothstein" wrote:

That looks like 6 numbers to me.<g

See Dana's post as to why the problem as asked can't be solved.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
1+3+5+7+15+19
--
Gary''s Student - gsnu200815



  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default 1+3+5+7+9+11+13+15+17+19=100 make a sum of 5 numbers make 50

Hi Joeu,

Thanks for Your post, it was very helpful for me.
But I would like to know if there's any way to make this code work for a set
of x numbers in a sheet range allowing me to specify how many numbers should
y add to get a result.
for example:

myfunction(LookUpRange as Range, NumberOfElements as integer, LookUpValue as
long)

The expected return of this function would be the address of cells that met
the requirements.

Thanks in Advance!!

"joeu2004" wrote:

On Nov 22, 4:24 am, Dana DeLouis wrote:
Ali wrote:
1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50


The sum of 5 Odd numbers is Odd also, so I don't
believe there is a solution as stated that equals
an even number (ie 50)


Why use well-founded reasoning when brute force will do the trick?

Just kidding. But the following might be a useful paradigm for
solving such problems when the answer is not so obvious.


Sub doit()
x = Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)
For i1 = 0 To UBound(x) - 4
For i2 = i1 + 1 To UBound(x) - 3
For i3 = i2 + 1 To UBound(x) - 2
For i4 = i3 + 1 To UBound(x) - 1
For i5 = i4 + 1 To UBound(x)
Sum = x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
If Sum = 50 Then Debug.Print Sum; x(i1); x(i2); x(i3); x(i4); x(i5)
Next i5: Next i4: Next i3: Next i2: Next i1
End Sub


PS: Lots of solutions when choosing 6. I wonder if the OP simply
mistyped.


  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 1+3+5+7+15+19-- Gary''s Student - gsnu200815

great work thanks for your help

On Saturday, November 22, 2008 3:31 AM Al wrote:


1+3+5+7+9+11+13+15+17+19=100
Choose 5 numbers from these 10 figures so there sum is = 50



On Saturday, November 22, 2008 3:51 AM Mike Middleton wrote:


Ali -

Tushar Mehta describes two methods with references to others:

http://www.tushar-mehta.com/excel/te...ues/index.html

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel



"" wrote in message
...



On Saturday, November 22, 2008 7:24 AM Dana DeLouis wrote:


Ali wrote:


The sum of 5 Odd numbers is Odd also, so I do not believe there is a
solution as stated that equals an even number (ie 50)

- - -
HTH
Dana DeLouis



On Saturday, November 22, 2008 7:30 AM GarysStuden wrote:


1+3+5+7+15+19
--
Gary''s Student - gsnu200815



On Saturday, November 22, 2008 2:05 PM joeu2004 wrote:


On Nov 22, 4:24=A0am, Dana DeLouis wrote:

Why use well-founded reasoning when brute force will do the trick?

Just kidding. But the following might be a useful paradigm for
solving such problems when the answer is not so obvious.


Sub doit()
x =3D Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)
For i1 =3D 0 To UBound(x) - 4
For i2 =3D i1 + 1 To UBound(x) - 3
For i3 =3D i2 + 1 To UBound(x) - 2
For i4 =3D i3 + 1 To UBound(x) - 1
For i5 =3D i4 + 1 To UBound(x)
Sum =3D x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
If Sum =3D 50 Then Debug.Print Sum; x(i1); x(i2); x(i3); x(i4); x(i5)
Next i5: Next i4: Next i3: Next i2: Next i1
End Sub


PS: Lots of solutions when choosing 6. I wonder if the OP simply
mistyped.



On Saturday, November 22, 2008 4:05 PM Rick Rothstein wrote:


That looks like 6 numbers to me.<g

See Dana's post as to why the problem as asked cannot be solved.

--
Rick (MVP - Excel)



On Saturday, November 22, 2008 6:38 PM Rick Rothstein wrote:


??? The OP's initial post said "Choose 5 numbers from these 10 figures so
there sum is = 50" (where he misspelled "their")... how do you read that as
allowing more than 5 numbers? I read it, to paraphrase, as this... Choose 5
number such that their sum equals 50"

--
Rick (MVP - Excel)


"rebel" wrote in message
...



On Saturday, November 22, 2008 7:14 PM rebel wrote:


but the "conditions" did not say *only* five. It just required use of five,
which the poster has complied with.


That was my initial response, but GS's solution appears to be compliant.



On Saturday, November 22, 2008 8:15 PM GarysStuden wrote:


A clear demonstration that just because a person can add does not mean they
can count.
--
Gary''s Student - gsnu200815


"Rick Rothstein" wrote:



On Saturday, November 22, 2008 9:13 PM smartin wrote:


joeu2004 wrote:

How cool!

Has anyone noticed that plotting x = Sum v. y = count of combinations
making Sum resembles a normal distribution? (Is it?)

Ok, perhaps that is not so fascinating, but try this:

Make x() an array of Fibonacci numbers and try the plot again. A
fractal-like pattern emerges. Evaluate the following for Test in
(0..4000) to appreciate.

'
Code:
 Public Function doit(Test As Long) As Long
 On Error GoTo ErrBreak
 
 Dim x(41) As Long
 Dim i1 As Long
 Dim i2 As Long
 Dim i3 As Long
 Dim i4 As Long
 Dim i5 As Long
 Dim Sum As Long
 Dim R As Long
 
 ' set up Fibonacci sequence
 x(0) = 0
 x(1) = 1
 For i1 = 2 To 41
      x(i1) = x(i1 - 2) + x(i1 - 1)
 Next i1
 
 For i1 = 0 To UBound(x) - 4
 For i2 = i1 + 1 To UBound(x) - 3
 For i3 = i2 + 1 To UBound(x) - 2
 For i4 = i3 + 1 To UBound(x) - 1
 For i5 = i4 + 1 To UBound(x)
      Sum = x(i1) + x(i2) + x(i3) + x(i4) + x(i5)
      If Sum = Test Then
          R = R + 1
      End If
 Next i5: Next i4: Next i3: Next i2:
 Debug.Print Test & "." & i1
 Next i1
 doit = R
 Exit Function
 ErrBreak: Stop
 Resume Next
 End Function
 '



On Saturday, November 22, 2008 9:39 PM ShaneDevenshir wrote:


I got more chuckles off this post, than any in a long time!

Next we should square the circle, and trisect the angle with compus and ruler.

1+3+5+7+9+11+13+15+17+19=100

=SUM(100/(9-5-3+1)) = 50

A Mensa quiz!

Some laughs,
Shane Devenshire



"Gary''s Student" wrote:



On Thursday, December 04, 2008 7:19 AM AshMor wrote:


Hi Joeu,

Thanks for Your post, it was very helpful for me.
But I would like to know if there's any way to make this code work for a set
of x numbers in a sheet range allowing me to specify how many numbers should
y add to get a result.
for example:

myfunction(LookUpRange as Range, NumberOfElements as integer, LookUpValue as
long)

The expected return of this function would be the address of cells that met
the requirements.

Thanks in Advance!!

"joeu2004" wrote:




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make table query will work in datasheet view but will not make tab WildlyHarry Excel Discussion (Misc queries) 0 August 28th 07 03:06 PM
How do I make make comment format default? delta_charm Excel Discussion (Misc queries) 1 July 8th 06 10:59 PM
make macros usable! make instructions in plain english !!!! Brainless_in_Boston Excel Worksheet Functions 0 March 2nd 06 03:27 PM
how do I make make my hyperlinks show the email address they are . Dustin Excel Discussion (Misc queries) 0 January 13th 05 01:39 AM
how i can make the numbers fatih terzioglu Excel Discussion (Misc queries) 1 December 29th 04 11:40 AM


All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"