[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [QUIZ] Mix and Match (#186

Peter Szinek

12/15/2008 3:20:00 PM

Is it possible to post a solution already? (I guess the question is
poetical, just strange that no one posted one yet - was it so hard, or no
one has time amidst the pre-XMas craze, or... ?)

Cheers,
Peter
___
http://s...
http://www.rubyra...


8 Answers

Matthew Moss

12/15/2008 3:32:00 PM

0


On Dec 15, 2008, at 9:19 AM, peter@rubyrailways.com wrote:

> Is it possible to post a solution already? (I guess the question is
> poetical, just strange that no one posted one yet - was it so hard,
> or no
> one has time amidst the pre-XMas craze, or... ?)

Perhaps a little harder than it may appear, or as you suggest, people
may be busy. In the worst case, a brute force solution should be easy
to do.

I may try this later today, or tomorrow, once I'm done with the last
papers I need for school and some other errands.



steven shingler

12/15/2008 9:44:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Mon, Dec 15, 2008 at 3:31 PM, Matthew Moss <matt@moss.name> wrote:

>
> On Dec 15, 2008, at 9:19 AM, peter@rubyrailways.com wrote:
>
> Is it possible to post a solution already? (I guess the question is
>> poetical, just strange that no one posted one yet - was it so hard, or no
>> one has time amidst the pre-XMas craze, or... ?)
>>
>
> Perhaps a little harder than it may appear, or as you suggest, people may
> be busy. In the worst case, a brute force solution should be easy to do.


Seeing as how this quiz has been so quiet, here's a v quick (and very brute
force!) attempt: http://pastie.... - - please be kind! :)


>
> I may try this later today, or tomorrow, once I'm done with the last papers
> I need for school and some other errands.
>
>

Matthew Moss

12/15/2008 11:08:00 PM

0


On Dec 15, 2008, at 3:44 PM, steven shingler wrote:

> On Mon, Dec 15, 2008 at 3:31 PM, Matthew Moss <matt@moss.name> wrote:
>
>>
>> On Dec 15, 2008, at 9:19 AM, peter@rubyrailways.com wrote:
>>
>> Is it possible to post a solution already? (I guess the question is
>>> poetical, just strange that no one posted one yet - was it so
>>> hard, or no
>>> one has time amidst the pre-XMas craze, or... ?)
>>>
>>
>> Perhaps a little harder than it may appear, or as you suggest,
>> people may
>> be busy. In the worst case, a brute force solution should be easy
>> to do.
>
>
> Seeing as how this quiz has been so quiet, here's a v quick (and
> very brute
> force!) attempt: http://pastie.... - - please be kind! :)


Minor point... I probably wasn't clear by "minimize group duplication."

In your code, you use dup_count in an attempt to avoid having a
particular recipient's gift contain duplication candles. Actually, I
like this requirement, although it wasn't what I meant. (Other subs:
please try and make each gift without candle duplication.)

What I meant is that if I give Janet garden/lavender/orange, I should
not also give Nancy garden/lavender/orange. I want a distinct
combination for each recipient.


Einar Magnús Boson

12/16/2008 12:42:00 AM

0


On 15.12.2008, at 23:07 , Matthew Moss wrote:

>
> On Dec 15, 2008, at 3:44 PM, steven shingler wrote:
>
>> On Mon, Dec 15, 2008 at 3:31 PM, Matthew Moss <matt@moss.name> wrote:
>>
>>>
>>> On Dec 15, 2008, at 9:19 AM, peter@rubyrailways.com wrote:
>>>
>>> Is it possible to post a solution already? (I guess the question is
>>>> poetical, just strange that no one posted one yet - was it so
>>>> hard, or no
>>>> one has time amidst the pre-XMas craze, or... ?)
>>>>
>>>
>>> Perhaps a little harder than it may appear, or as you suggest,
>>> people may
>>> be busy. In the worst case, a brute force solution should be easy
>>> to do.
>>
>>
>> Seeing as how this quiz has been so quiet, here's a v quick (and
>> very brute
>> force!) attempt: http://pastie.... - - please be kind! :)
>
>
> Minor point... I probably wasn't clear by "minimize group
> duplication."
>
> In your code, you use dup_count in an attempt to avoid having a
> particular recipient's gift contain duplication candles. Actually, I
> like this requirement, although it wasn't what I meant. (Other subs:
> please try and make each gift without candle duplication.)
>
> What I meant is that if I give Janet garden/lavender/orange, I
> should not also give Nancy garden/lavender/orange. I want a distinct
> combination for each recipient.
>
>


I am not about to partake but these requirements seem to conflict, no?

ppl = [:janet, :nancy, :betty]
candles = [:lavender => 3, :garden => 3, :orange => 3].

the following seems like the best answer to me but contains duplication,

lav, lav, ger
gar, or, or
gar, or, lav


the "uniquest" would be:

lav, lav, lav
gar, gar, gar
or. or. or

but it has more duplication whereas the least duplication has no
uniqueness:
lav, gar, or
lav, gar, or
lav, gar, or

How is uniqueness supposed to be balanced against duplication?

einarmagnus




Matthew Moss

12/16/2008 1:00:00 AM

0


On Dec 15, 2008, at 6:41 PM, Einar Magn=FAs Boson wrote:

>
> On 15.12.2008, at 23:07 , Matthew Moss wrote:
>
>>
>> On Dec 15, 2008, at 3:44 PM, steven shingler wrote:
>>
>>> On Mon, Dec 15, 2008 at 3:31 PM, Matthew Moss <matt@moss.name> =20
>>> wrote:
>>>
>>>>
>>>> On Dec 15, 2008, at 9:19 AM, peter@rubyrailways.com wrote:
>>>>
>>>> Is it possible to post a solution already? (I guess the question is
>>>>> poetical, just strange that no one posted one yet - was it so =20
>>>>> hard, or no
>>>>> one has time amidst the pre-XMas craze, or... ?)
>>>>>
>>>>
>>>> Perhaps a little harder than it may appear, or as you suggest, =20
>>>> people may
>>>> be busy. In the worst case, a brute force solution should be easy =20=

>>>> to do.
>>>
>>>
>>> Seeing as how this quiz has been so quiet, here's a v quick (and =20
>>> very brute
>>> force!) attempt: http://pastie.... - - please be kind! :)
>>
>>
>> Minor point... I probably wasn't clear by "minimize group =20
>> duplication."
>>
>> In your code, you use dup_count in an attempt to avoid having a =20
>> particular recipient's gift contain duplication candles. Actually, =20=

>> I like this requirement, although it wasn't what I meant. (Other =20
>> subs: please try and make each gift without candle duplication.)
>>
>> What I meant is that if I give Janet garden/lavender/orange, I =20
>> should not also give Nancy garden/lavender/orange. I want a =20
>> distinct combination for each recipient.
>>
>>
>
>
> I am not about to partake but these requirements seem to conflict, no?
>
> ppl =3D [:janet, :nancy, :betty]
> candles =3D [:lavender =3D> 3, :garden =3D> 3, :orange =3D> 3].
>
> the following seems like the best answer to me but contains =20
> duplication,
>
> lav, lav, ger
> gar, or, or
> gar, or, lav
>
>
> the "uniquest" would be:
>
> lav, lav, lav
> gar, gar, gar
> or. or. or
>
> but it has more duplication whereas the least duplication has no =20
> uniqueness:
> lav, gar, or
> lav, gar, or
> lav, gar, or
>
> How is uniqueness supposed to be balanced against duplication?

By buying more candles. :D

But seriously, it will depend on the input. If I had to choose between =20=

those options, I'd prefer to give individuals a variety of fragrances =20=

(avoid duplication more than enforcing uniqueness).


Peter Szinek

12/16/2008 1:14:00 AM

0

>
> But seriously, it will depend on the input. If I had to choose between
> those options, I'd prefer to give individuals a variety of fragrances
> (avoid duplication more than enforcing uniqueness).

oops that sucks (should have read the quiz more carefully) - my solution
is enforcing uniqueness but doesn't care about duplication at all :(
Shouldn't take too much effort to add that though... will do tomorrow.

Cheers,
Peter
___
http://s...
http://www.rubyra...



Peter Szinek

12/16/2008 1:57:00 AM

0

> But seriously, it will depend on the input. If I had to choose between
> those options, I'd prefer to give individuals a variety of fragrances
> (avoid duplication more than enforcing uniqueness).

Ok so a beefed up version (no duplicates if possible, and as unique as
possible):

http://pastie....

Cheers,
Peter
___
http://s...
http://www.rubyra...




Andrew W

12/14/2012 9:13:00 PM

0

"duke" <duckgumbo32@cox.net> wrote in message
news:k8omc898u76migpd641ie07k8m3sgcasqq@4ax.com
> On Thu, 13 Dec 2012 20:22:50 +1100, "Andrew W"
> <remove_ajwerner@optusnet.com.au> wrote:
>
>> "duke" <duckgumbo32@cox.net> wrote in message
>> news:g0ehc8dom6kd5bni66ubth90usditquhsc@4ax.com
>>> On Wed, 12 Dec 2012 16:22:28 +1100, "Andrew W"
>>> <remove_ajwerner@optusnet.com.au> wrote:
>>>
>>>> "duke" <duckgumbo32@cox.net> wrote in message
>>>> news:b3tec85erdnju327mo5bfqcmdu35lf25oa@4ax.com
>>>>> On Tue, 11 Dec 2012 09:10:44 +1100, "Andrew W"
>>>>> <remove_ajwerner@optusnet.com.au> wrote:
>>>>>
>>>>>> "duke" <duckgumbo32@cox.net> wrote in message
>>>>>> news:4oecc89o9g3q5div9j6m4tb0rp84hbng5h@4ax.com
>>>>>>> On Mon, 10 Dec 2012 11:55:42 +1100, "Andrew W"
>>>>>>> <remove_ajwerner@optusnet.com.au> wrote:
>>>>>>>>>
>>>>>>>>> And yet you told God to go away and you now accept tao.
>>>>>>>
>>>>>>>> We can't tell someone to go away if they never came to us in
>>>>>>>> the first place.
>>>>>>>
>>>>>>> LG quit God and turned to tao.
>>>>>
>>>>>> Everyone should quit the Catholic version of God.
>>>>>
>>>>> Hell no. Looking at what you did is reason enough not to.
>>>
>>>> And what did I do dupe? You think you're God and can see what
>>>> people do?
>>>
>>> Now I know you're smoking bad rope.
>
>> Wrong as usual. I don't smoke anything.
>> Do you ever get anything right about anyone or anything?
>
> I've already firmly established that you are the village idiot that
> knows nothing about Christianity. That's enough.
>

99% of people here have firmly established that YOU are one of the village
idiots here.


--
Religions breed hypocrisy and self-righteousness.

Many Christians spend more time looking down on other people than up
towards Christ.