maths prob

Off-topic chat, talk about whatever you like..
Locked
User avatar
trayhop123
Senior Member
Posts: 4901
Joined: Tue Jan 22, 2008 9:21 pm
Location: leicester

maths prob

Post by trayhop123 »

ok work this out .....not a trick question ,,, genuine answer to follow in a day or two.


you have 200quid your off to the fruit shop ( quite apt for this site lol )
anyway lets see

grapes = 5p
melons = 1 quid
plums = 5 quid

now u must spend exactly 200quid and you must come back with exactly 200fruit

the only rule is you must have at least 1 of each fruit ( so you cant be a clever twat and just buy 200 melons lol)


will post the solution in a few days if nobody gets it. good luck




STOP PRESS ( THIS HAS BEEN ANSWERD BELOW SO DONT SCROLL DOWN IF YOU DONT WANNA CHEAT)
Little discipline = BIG issue

**** ****
Mr Bubbles
Senior Member
Posts: 225
Joined: Fri Apr 20, 2007 1:02 pm

Post by Mr Bubbles »

hidden as requested
User avatar
trayhop123
Senior Member
Posts: 4901
Joined: Tue Jan 22, 2008 9:21 pm
Location: leicester

Post by trayhop123 »

feck me that wer fast well done ...........now edit ya post and let someone else have a crack
Little discipline = BIG issue

**** ****
User avatar
gambogaz1
Senior Member
Posts: 3143
Joined: Mon Apr 16, 2007 6:43 pm

Post by gambogaz1 »

If you new his profession you wouldn't be so surprised. :)
betchrider wrote:You go upto a bird and grab her quim and say "im gonna knock the fuck outta this" and see what happens
User avatar
Istenem
Senior Member
Posts: 5918
Joined: Sat Apr 30, 2005 2:42 pm
Location: the nation's capital
Contact:

Post by Istenem »

are the plums made out of solid gold?
nobody ever wins on those things.
Weyland
Senior Member
Posts: 1001
Joined: Fri Nov 18, 2005 9:58 pm

Post by Weyland »

I found another:

Plums: 38
Melons: 2
Grapes: 160

I think there's only the two solutions.
Drpepper
Senior Member
Posts: 1389
Joined: Sun May 01, 2005 12:16 am
Location: North East coast

Post by Drpepper »

I was originally going to try and solve it as a linear programming problem then i realised trial and error would probably be quicker, and by then i was beaten :( .
User avatar
trayhop123
Senior Member
Posts: 4901
Joined: Tue Jan 22, 2008 9:21 pm
Location: leicester

Post by trayhop123 »

and posted as promised mr bubs got it first ,,,,,,,, but now im intrigued by gazs comment what r u then ,,,,,maths professor ?????
Little discipline = BIG issue

**** ****
User avatar
trayhop123
Senior Member
Posts: 4901
Joined: Tue Jan 22, 2008 9:21 pm
Location: leicester

Post by trayhop123 »

laughs at drpepper ......... i openly admit i was told the answer ..... couldn't work it out myself....
Little discipline = BIG issue

**** ****
Mr Bubbles
Senior Member
Posts: 225
Joined: Fri Apr 20, 2007 1:02 pm

Post by Mr Bubbles »

trayhop123 wrote:and posted as promised mr bubs got it first ,,,,,,,, but now im intrigued by gazs comment what r u then ,,,,,maths professor ?????
LOL,

I work as a accountant for a living, as the numbers were easy on the eye (i.e 1's & 5's) I simply worked it out by trial & error.
Weyland
Senior Member
Posts: 1001
Joined: Fri Nov 18, 2005 9:58 pm

Post by Weyland »

I, on the other hand, cheated like a bastard, and wrote this:

Code: Select all

unsigned int p, m, g;

for(p = 1; p <= 200; p++)
{
  for(m = 1; m <= 200; m++)
  {
    for(g = 1; g <= 200; g++)
    {
      if(((p + m + g) == 200) &&
         (((p * 500) + (m * 100) + (g * 5)) == 20000))
      {
        printf("p == %d, m == %d, g == %d\n", p, m, g);
      }
    }
  }
}
...an appalling brute-force solution, but it's what I'd've done in my head anyway. ;)
Locked