Profile

austin_dern: Inspired by Krazy Kat, of kourse. (Default)
austin_dern

June 2025

S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 2728
2930     

Custom Text

Most Popular Tags

The Price Is Right started up its 41st season last week and so I should start up again my tracking of its minor statistical quirks. They didn't play ``Pay The Rent'' on the season premiere, throwing me, but they did for the Friday, 28 September episode, which makes sense as it was the conclusion of their male-models tryout week and were sure to do something for the conclusion of that. (I think they're maybe 20 years behind the curve on getting a male model but otherwise haven't any opinion on them.)

Anyway, for the first ``Pay The Rent'' of the season the items were: Pasta sauce ($1.99), Carrot Juice ($3.79), Cook-Top Cleaner ($5.49 and with a manufacturer's logo that's just so wonderfully 70s), Deodorant ($1.59), Twizzlers ($2.29), and Cake flour ($3.59).

The contestant got off on a wrong but plausible foot by putting at the base layer the deodorant ($1.59), then the pasta sauce and Twizzlers ($4.28), and then the carrot juice and cake flour ($7.38) and mercifully fled with her $10,000. Drew Carey pointed out that one (other) contestant had ever placed items correctly in order --- but left at the $10,000 level rather than get the whole $100,000 --- and then revealed that no, she wasn't the second.

I briefly thought there might be two solutions to this, but no, as best I can tell the only winning arrangement is: Cake flour ($3.59); then pasta sauce and Twizzlers ($4.28); then carrot juice and deodorant ($5.38); then cleaner ($5.49), and how vicious do you have to be that the separation between two levels is a measly eleven cents?

Anyway, for this season, then, the price range has been $3.90. The level range has been $3.20, which, yeah, could be worse.

Trivia: Two months after the Great Fire of New York City (1835) twenty empty lots were sold for $765,000. Before the Great Fire, these lots were worth $93,000. Source: The Culture of Calamity: Disaster and the Making of Modern America, Kevin Rozario.

Currently Reading: Gilded City: Scandal and Sensation In Turn-Of-The-Century New York, M H Dunlop.

(no subject)

Date: 2012-10-02 05:25 am (UTC)
From: [identity profile] http://users.livejournal.com/_fluffy/
I should write a Prolog solver for Pay The Rent. It should only be a few lines of code, right?

(no subject)

Date: 2012-10-02 05:38 am (UTC)
From: [identity profile] http://users.livejournal.com/_fluffy/
hahaha no actually it's just one line.

paytherent(X,[A,B1,B2,C1,C2,D]) :- permutation(X,[A,B1,B2,C1,C2,D]), B1<B2, B1+B2 > A, C1<C2, C1+C2 > B1+B2, D > C1+C2.

According to this, there are actually a few different solutions for the one you listed there:

| ?- paytherent([180,379,549,159,229,359],X).

X = [379,180,229,159,359,549] ? a

X = [379,159,229,180,359,549]

X = [229,159,379,180,359,549]

X = [359,180,229,159,379,549]
Edited Date: 2012-10-02 05:43 am (UTC)

(no subject)

Date: 2012-10-02 05:52 am (UTC)
From: [identity profile] http://users.livejournal.com/_fluffy/
Oops, I must have brainfarted when transcribing the prices over. There are still two solutions, though (here's a version which also prints out the rows' totals):

| ?- paytherent([199,379,549,159,229,359],X,Y).

X = [379,199,229,159,359,549]
Y = [379,428,518,549] ? a

X = [359,199,229,159,379,549]
Y = [359,428,538,549]

(no subject)

Date: 2012-10-02 03:55 pm (UTC)
From: [identity profile] austin-dern.livejournal.com
I quite appreciate your working out code for it and double-checking my results. I normally use Octave (an open-source Matlab clone) to try out permutations by hand and hadn't got around to writing an automated solver for it, but I need to reinstall after upgrading my OS a little while ago and was working out combinations the old-fashioned way, so I obviously missed it.

Thanks again.

(no subject)

Date: 2012-10-02 03:57 pm (UTC)
From: [identity profile] http://users.livejournal.com/_fluffy/
Prolog is GREAT for permutation analysis. :) It almost makes the fact my CS department was theory-oriented-up-their-own-butthole worth it!

(no subject)

Date: 2012-10-02 04:02 pm (UTC)
From: [identity profile] http://users.livejournal.com/_fluffy/
Oh, and here's the version which also finds the row values:

paytherent(X,[A,[B1,B2],[C1,C2],D],[A,B3,C3,D]) :- 
	permutation(X,[A,B1,B2,C1,C2,D]), 
	B2>B1, B1+B2 > A, B3 #= B1+B2,
	C2>C1, C1+C2 > B1+B2, C3 #= C1+C2,
        D > C1+C2.


You call it with paytherent(Pricelist,Order,RowTotals), and as always (for Prolog) pass in a _ to say you don't care about that parameter.
Edited Date: 2012-10-02 04:03 pm (UTC)

Expand Cut Tags

No cut tags

Style Credit