View Full Version : Even Sum Problem


iwonde
10-08-2008, 02:14 AM
How many subsets of three different integers between 1 and 90 inclusive are there whose sum is an even number?

vinux
10-08-2008, 02:22 AM
Hint: Combination.
(E= even O= Odd)
Sum is:
Even = 3E or 1E + 2O

Dr N S Gandhi Prasad
10-08-2008, 07:23 AM
Write a few lines in BASIC
5 Count=0: Sum=0
10 For I = 1 to 90
20 For J= 1 to 90
30 For K= 1 to 90
40 set= I+J+K
50 if (SET - 2*Int(SET/2)=0) go to 85
60 Next k
70 Next J
80 Next I
85 go to 110
86 Sum= Sum + SET
87 Count=Count + 1
90 Next K
95 Next j
100 Next I
105 Print Sum, Count
110 stop

Dr N S Gandhi Prasad
10-08-2008, 07:27 AM
Replace
85 Go TO 110
with
85 Go To 105
Dr N S Gandhi Prasad

Martingale
10-08-2008, 08:37 AM
Replace
85 Go TO 110
with
85 Go To 105
Dr N S Gandhi Prasad

Goto statement!!! :eek:
UG...



:D

Martingale
10-08-2008, 10:53 AM
Write a few lines in BASIC
5 Count=0: Sum=0
10 For I = 1 to 90
20 For J= 1 to 90
30 For K= 1 to 90
40 set= I+J+K
50 if (SET - 2*Int(SET/2)=0) go to 85
60 Next k
70 Next J
80 Next I
85 go to 110
86 Sum= Sum + SET
87 Count=Count + 1
90 Next K
95 Next j
100 Next I
105 Print Sum, Count
110 stop

There is a problem here

vinux
10-09-2008, 01:09 AM
I don't understand that what is the need of computer program for this simple problem.

There are 45 even numbers and 45 odd numbers .
So the answer will be = 45C3 + 45C1*45C2

Martingale
10-09-2008, 08:27 AM
I don't understand that what is the need of computer program for this simple problem.

There are 45 even numbers and 45 odd numbers .
So the answer will be = 45C3 + 45C1*45C2

there isn't. definitely no need for a program written in basic :D