Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

program to solve assignment problem?

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


esigra at gmail

Nov 2, 2009, 12:49 PM

Post #1 of 20 (235 views)
Permalink
program to solve assignment problem?

Is there some simple little program to solve assignment problems?
Suppose that someone bought k meat (160), m fish (30) and n milk (15)
for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
700. (A solution happens to be k = 4, m = 2, n = 0. An additional
condition could be that he bought at most 6 items; k + m + n <= 6. That
would eliminate solutions like k = 4, m = 0, n = 4.)


marcusw at cox

Nov 2, 2009, 2:48 PM

Post #2 of 20 (225 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On 11/2/2009 3:49 PM, Erik wrote:
> Is there some simple little program to solve assignment problems?
> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> condition could be that he bought at most 6 items; k + m + n <= 6. That
> would eliminate solutions like k = 4, m = 0, n = 4.)
>
What?


msulli1355 at gmail

Nov 2, 2009, 2:59 PM

Post #3 of 20 (224 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Mon, 2009-11-02 at 17:48 -0500, Marcus Wanner wrote:
> On 11/2/2009 3:49 PM, Erik wrote:
> > Is there some simple little program to solve assignment problems?
> > Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> > for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> > 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> > condition could be that he bought at most 6 items; k + m + n <= 6. That
> > would eliminate solutions like k = 4, m = 0, n = 4.)
> >
> What?
>

Can't one do this kind of thing in python?


neil at digimed

Nov 2, 2009, 3:21 PM

Post #4 of 20 (225 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Mon, 02 Nov 2009 21:49:06 +0100, Erik wrote:

> Is there some simple little program to solve assignment problems?
> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> condition could be that he bought at most 6 items; k + m + n <= 6. That
> would eliminate solutions like k = 4, m = 0, n = 4.)

Have you tried apps-edu/domyhomeworkforme?


--
Neil Bothwick

Life is pleasant. Death is peaceful. Its the transition thats
troublesome. - Isaac Asimov
Attachments: signature.asc (0.19 KB)


marduk at letterboxes

Nov 2, 2009, 3:26 PM

Post #5 of 20 (228 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Mon, 2009-11-02 at 21:49 +0100, Erik wrote:
> Is there some simple little program to solve assignment problems?
> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> condition could be that he bought at most 6 items; k + m + n <= 6.
> That
> would eliminate solutions like k = 4, m = 0, n = 4.)
>

You mean you want a program to do your homework assignment?

-a


wwong at math

Nov 2, 2009, 4:46 PM

Post #6 of 20 (217 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Mon, Nov 02, 2009 at 09:49:06PM +0100, Penguin Lover Erik squawked:
> Is there some simple little program to solve assignment problems?
> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> condition could be that he bought at most 6 items; k + m + n <= 6. That
> would eliminate solutions like k = 4, m = 0, n = 4.)

An odd question deserves an odd answer: try Metafont. Donald Knuth
implemented in it a general linear equation solver / inequality
optimizer, though learning the syntax can be a little bit tricky.

W

--
Do you think paper grow on trees?
~Sarah Grant. To Tal Zamir, after Prof Cutts commented on Tal's
requesting the third copy of one handout...
Sortir en Pantoufles: up 1060 days, 23:36


rdalek1967 at gmail

Nov 2, 2009, 5:27 PM

Post #7 of 20 (218 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Willie Wong wrote:
> On Mon, Nov 02, 2009 at 09:49:06PM +0100, Penguin Lover Erik squawked:
>
>> Is there some simple little program to solve assignment problems?
>> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
>> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
>> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
>> condition could be that he bought at most 6 items; k + m + n <= 6. That
>> would eliminate solutions like k = 4, m = 0, n = 4.)
>>
>
> An odd question deserves an odd answer: try Metafont. Donald Knuth
> implemented in it a general linear equation solver / inequality
> optimizer, though learning the syntax can be a little bit tricky.
>
> W
>
>

And maybe it will be easier to just do his own homework instead of
letting a computer do it for him.

I would like to see how he cheats on test day tho. Think he can bring
his puter with him?

Dale

:-) :-)


neil at digimed

Nov 2, 2009, 6:02 PM

Post #8 of 20 (224 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:

> And maybe it will be easier to just do his own homework instead of
> letting a computer do it for him.

Maybe the assignment is to write a program to solve the equation.


--
Neil Bothwick

What do you have when you have six lawyers buried up to their necks in
sand? Not enough sand.
Attachments: signature.asc (0.19 KB)


marcusw at cox

Nov 2, 2009, 6:48 PM

Post #9 of 20 (218 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On 11/2/2009 5:59 PM, Michael Sullivan wrote:
> On Mon, 2009-11-02 at 17:48 -0500, Marcus Wanner wrote:
>
>> On 11/2/2009 3:49 PM, Erik wrote:
>>
>>> Is there some simple little program to solve assignment problems?
>>> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
>>> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
>>> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
>>> condition could be that he bought at most 6 items; k + m + n <= 6. That
>>> would eliminate solutions like k = 4, m = 0, n = 4.)
>>>
>>>
>> What?
>>
>>
>
> Can't one do this kind of thing in python?
>
That is what I would do, if I couldn't do it on paper...

But seriously, this does not belong on this list.

Marcus


rdalek1967 at gmail

Nov 2, 2009, 9:18 PM

Post #10 of 20 (216 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Neil Bothwick wrote:
> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
>
>
>> And maybe it will be easier to just do his own homework instead of
>> letting a computer do it for him.
>>
>
> Maybe the assignment is to write a program to solve the equation.
>
>
>

That's a idea too. Didn't think of that.

Dale

:-) :-)


shrdlu at unlimitedmail

Nov 3, 2009, 5:06 AM

Post #11 of 20 (210 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Tuesday 03 Nov 2009, bn wrote:

> Dale ha scritto:
> > Neil Bothwick wrote:
> >> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
> >>> And maybe it will be easier to just do his own homework instead of
> >>> letting a computer do it for him.
> >>
> >> Maybe the assignment is to write a program to solve the equation.
> >
> > That's a idea too. Didn't think of that.
>
> In this case I suggest the following programming languages:
> - Brainfuck http://en.wikipedia.org/wiki/Brainfuck
> - OISC http://en.wikipedia.org/wiki/OISC
> - Thue http://en.wikipedia.org/wiki/Thue_(programming_language)
> - Unlambda http://en.wikipedia.org/wiki/Unlambda_programming_language
> - Befunge http://en.wikipedia.org/wiki/Befunge
> - Intercal http://en.wikipedia.org/wiki/Intercal
> - Malbolge http://en.wikipedia.org/wiki/Malbolge

You forgot http://compsoc.dur.ac.uk/whitespace/


brullonulla at gmail

Nov 3, 2009, 5:08 AM

Post #12 of 20 (209 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Dale ha scritto:
> Neil Bothwick wrote:
>> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
>>
>>
>>> And maybe it will be easier to just do his own homework instead of
>>> letting a computer do it for him.
>>>
>> Maybe the assignment is to write a program to solve the equation.
>>
>>
>>
>
> That's a idea too. Didn't think of that.

In this case I suggest the following programming languages:
- Brainfuck http://en.wikipedia.org/wiki/Brainfuck
- OISC http://en.wikipedia.org/wiki/OISC
- Thue http://en.wikipedia.org/wiki/Thue_(programming_language)
- Unlambda http://en.wikipedia.org/wiki/Unlambda_programming_language
- Befunge http://en.wikipedia.org/wiki/Befunge
- Intercal http://en.wikipedia.org/wiki/Intercal
- Malbolge http://en.wikipedia.org/wiki/Malbolge


alan.mckinnon at gmail

Nov 3, 2009, 5:13 AM

Post #13 of 20 (210 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Tuesday 03 November 2009 15:06:43 Etaoin Shrdlu wrote:
> On Tuesday 03 Nov 2009, bn wrote:
> > Dale ha scritto:
> > > Neil Bothwick wrote:
> > >> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
> > >>> And maybe it will be easier to just do his own homework instead of
> > >>> letting a computer do it for him.
> > >>
> > >> Maybe the assignment is to write a program to solve the equation.
> > >
> > > That's a idea too. Didn't think of that.
> >
> > In this case I suggest the following programming languages:
> > - Brainfuck http://en.wikipedia.org/wiki/Brainfuck
> > - OISC http://en.wikipedia.org/wiki/OISC
> > - Thue http://en.wikipedia.org/wiki/Thue_(programming_language)
> > - Unlambda http://en.wikipedia.org/wiki/Unlambda_programming_language
> > - Befunge http://en.wikipedia.org/wiki/Befunge
> > - Intercal http://en.wikipedia.org/wiki/Intercal
> > - Malbolge http://en.wikipedia.org/wiki/Malbolge
>
> You forgot http://compsoc.dur.ac.uk/whitespace/

And COBOL too.

COBOL - the original obfuscated language. Very cleverly designed to outwardly
appear to not be obfuscated at all, but just beneath that veneer lies a
different world entirely.

--
alan dot mckinnon at gmail dot com


rdalek1967 at gmail

Nov 3, 2009, 6:24 AM

Post #14 of 20 (208 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Alan McKinnon wrote:
> On Tuesday 03 November 2009 15:06:43 Etaoin Shrdlu wrote:
>
>> On Tuesday 03 Nov 2009, bn wrote:
>>
>>> Dale ha scritto:
>>>
>>>> Neil Bothwick wrote:
>>>>
>>>>> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
>>>>>
>>>>>> And maybe it will be easier to just do his own homework instead of
>>>>>> letting a computer do it for him.
>>>>>>
>>>>> Maybe the assignment is to write a program to solve the equation.
>>>>>
>>>> That's a idea too. Didn't think of that.
>>>>
>>> In this case I suggest the following programming languages:
>>> - Brainfuck http://en.wikipedia.org/wiki/Brainfuck
>>> - OISC http://en.wikipedia.org/wiki/OISC
>>> - Thue http://en.wikipedia.org/wiki/Thue_(programming_language)
>>> - Unlambda http://en.wikipedia.org/wiki/Unlambda_programming_language
>>> - Befunge http://en.wikipedia.org/wiki/Befunge
>>> - Intercal http://en.wikipedia.org/wiki/Intercal
>>> - Malbolge http://en.wikipedia.org/wiki/Malbolge
>>>
>> You forgot http://compsoc.dur.ac.uk/whitespace/
>>
>
> And COBOL too.
>
> COBOL - the original obfuscated language. Very cleverly designed to outwardly
> appear to not be obfuscated at all, but just beneath that veneer lies a
> different world entirely.
>
>

Is this that once a month thread where we get to have a little fun?

Dale

:-) :-)


esigra at gmail

Nov 3, 2009, 6:42 AM

Post #15 of 20 (209 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Dale skrev:
> Alan McKinnon wrote:
>
>> On Tuesday 03 November 2009 15:06:43 Etaoin Shrdlu wrote:
>>
>>
>>> On Tuesday 03 Nov 2009, bn wrote:
>>>
>>>
>>>> Dale ha scritto:
>>>>
>>>>
>>>>> Neil Bothwick wrote:
>>>>>
>>>>>
>>>>>> On Mon, 02 Nov 2009 19:27:13 -0600, Dale wrote:
>>>>>>
>>>>>>
>>>>>>> And maybe it will be easier to just do his own homework instead of
>>>>>>> letting a computer do it for him.
>>>>>>>
>>>>>>>
>>>>>> Maybe the assignment is to write a program to solve the equation.
>>>>>>
>>>>>>
>>>>> That's a idea too. Didn't think of that.
>>>>>
>>>>>
>>>> In this case I suggest the following programming languages:
>>>> - Brainfuck http://en.wikipedia.org/wiki/Brainfuck
>>>> - OISC http://en.wikipedia.org/wiki/OISC
>>>> - Thue http://en.wikipedia.org/wiki/Thue_(programming_language)
>>>> - Unlambda http://en.wikipedia.org/wiki/Unlambda_programming_language
>>>> - Befunge http://en.wikipedia.org/wiki/Befunge
>>>> - Intercal http://en.wikipedia.org/wiki/Intercal
>>>> - Malbolge http://en.wikipedia.org/wiki/Malbolge
>>>>
>>>>
>>> You forgot http://compsoc.dur.ac.uk/whitespace/
>>>
>>>
>> And COBOL too.
>>
>> COBOL - the original obfuscated language. Very cleverly designed to outwardly
>> appear to not be obfuscated at all, but just beneath that veneer lies a
>> different world entirely.
>>
>>
>>
>
> Is this that once a month thread where we get to have a little fun?


Fine. I think that I found a relevant package: sci-mathematics/glpk-4.35

It even has an example called "assignment problem". If the package is
installed with the USE-flag "examples", the example will be installed to
[/usr/share/doc/glpk-4.35/examples/assign.mod]. I will look into that.
Looks infinitely more useful than most suggestions that I got so far.


wireless at tampabay

Nov 3, 2009, 7:22 AM

Post #16 of 20 (209 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Erik <esigra <at> gmail.com> writes:


> Is there some simple little program to solve assignment problems?
> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
> condition could be that he bought at most 6 items; k + m + n <= 6. That
> would eliminate solutions like k = 4, m = 0, n = 4.)

First of all, if you post something to the list like this,
put OT for off topic. Second of all, if you make *ANY* attempt
to solve this on your own, you *might* get some programming
tips, depending on which language you use. Personally, I'd just
use C.


Most important of all, the solution is trivial. Look at your last
stated 'boundary condition', and get your head out of programming
and think logically........




goodluck,
James


alan.mckinnon at gmail

Nov 3, 2009, 7:41 AM

Post #17 of 20 (211 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On Tuesday 03 November 2009 16:42:14 Erik wrote:
> Fine. I think that I found a relevant package: sci-mathematics/glpk-4.35
>
> It even has an example called "assignment problem". If the package is
> installed with the USE-flag "examples", the example will be installed to
> [/usr/share/doc/glpk-4.35/examples/assign.mod]. I will look into that.
> Looks infinitely more useful than most suggestions that I got so far.

That's because you worded your question like a dumbass user asking someone
else to do their homework for him. That's exactly what it looked like so
that's exactly the answers you got.

Now, if you want people to be more helpful, there's some stuff you have to do:

1. Realise that no-one else can see inside your head
2. Realise that none of us are telepathic
3. None of us are mind readers
4. We don't know what you mean, we only know what you wrote
5. Make it possible for people to help you by clearly stating what it is that
you need help on in an unambiguous manner that can be clearly understood.
Something like this:

========= start example ===========
Hi,

I need to solve a bunch of maths equations. Here's an example:

[stuff about k, m, n and boundary conditions]

I don't need an answer (I already know that using pen and paper), I need to
demonstrate the path to a solution, and there's lots more such equations to
solve. I had a look in sci-mathematics but nothing there has a likely looking
name,a nd the download size leads me to believe most of them are overkill for
this.

Anyone have experience with this kind of thing and can recommend an entry-
level app that gets the job done easily?
============== end example ===================

Now, a mail like that would have gotten you lots of recommendations, would
have sparked a fascinating debate on how to solve it programatically, probably
produce 9 solutions in 4 languages in the first 6 hours and also include a
detailed treatise on why portage might be able to do it but revdep-rebuild
cannot (by design).

See where I'm going with this?

--
alan dot mckinnon at gmail dot com


esigra at gmail

Nov 3, 2009, 8:03 AM

Post #18 of 20 (211 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Alan McKinnon skrev:
> That's because you worded your question like a dumbass user asking someone
> else to do their homework for him.

I did not mention anything related to homework or that I would still be
a student or anything like that. It was just a standard question of
knowing which Gentoo package is best suited for a particular task.
(Maybe the problem is offtopic until the user got so far that he knows
which package he should be using.)

Maybe next month I will ask which program I should use to solve the
stable marriage problem so you can have your fun again.


brullonulla at gmail

Nov 3, 2009, 8:28 AM

Post #19 of 20 (214 views)
Permalink
Re: program to solve assignment problem? [In reply to]

Erik ha scritto:
> Alan McKinnon skrev:
>> That's because you worded your question like a dumbass user asking someone
>> else to do their homework for him.
>
> I did not mention anything related to homework or that I would still be
> a student or anything like that. It was just a standard question of
> knowing which Gentoo package is best suited for a particular task.

You did not mention, but all it seemed is that you were asking "how do I
solve this equation".
Alan was maybe not very polite, but he explained you well why it hasn't
been taken seriously.

m.


stroller at stellar

Nov 3, 2009, 9:11 AM

Post #20 of 20 (209 views)
Permalink
Re: program to solve assignment problem? [In reply to]

On 3 Nov 2009, at 15:41, Alan McKinnon wrote:

> On Tuesday 03 November 2009 16:42:14 Erik wrote:
>> Fine. I think that I found a relevant package: sci-mathematics/
>> glpk-4.35
>>
>> It even has an example called "assignment problem". If the package is
>> installed with the USE-flag "examples", the example will be
>> installed to
>> [/usr/share/doc/glpk-4.35/examples/assign.mod]. I will look into
>> that.
>> Looks infinitely more useful than most suggestions that I got so far.
>
> That's because you worded your question like a dumbass user asking
> someone
> else to do their homework for him. That's exactly what it looked
> like so
> that's exactly the answers you got.

I'm a little surprised anyone read it this way. This is the kind of
maths problem set for 12 year olds.

Upon reading the OP I assumed him to be a parent wanting to check his
kid's homework, or a maths teacher wanting to set such problems.

Stroller.

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.