wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> cs >> Number of block arrangements
(Message started by: peninha on Mar 30th, 2010, 5:20am)

Title: Number of block arrangements
Post by peninha on Mar 30th, 2010, 5:20am
You are given N distinct blocks of height 1…N. In how many ways can you arrange these blocks in a row such that when viewed from left you see only L blocks (rest are hidden by taller blocks) and when seen from right you see only R blocks? Example given N=3, L=2, R=1 there is only one arrangement {2, 1, 3} while for N=3, L=2, R=2 there are two ways {1, 3, 2} and {2, 3, 1}.

Title: Re: Number of block arrangements
Post by SMQ on Mar 30th, 2010, 5:41am
The search function is your friend: we discussed this earlier this month (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_cs;action=display;num=1267700834).

--SMQ

Title: Re: Number of block arrangements
Post by peninha on Mar 30th, 2010, 5:43am
Thanks, I missed that one  :-[



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board