All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars perplexus dot info Ten Items and Two Boxes (Posted on 2013-08-12) You have two boxes, one is filled with 10 items and the other is empty. You are allowed to transfer items one at a time from one box to the other (transfers may to either way).

There are 2^10=1024 ways to split the items between the two boxes. Can you make all the ways without repetition using only the transfer rule described above?

 See The Solution Submitted by Brian Smith No Rating Comments: ( Back to comment list | You must be logged in to post comments.) program generating the list Comment 2 of 2 | (In reply to solution by Charlie)

OPEN "10items2.txt" FOR OUTPUT AS #2
FOR i = 0 TO 1023
s\$ = ""
n = i
FOR j = 1 TO 10
s\$ = LTRIM\$(STR\$(n MOD 2)) + s\$
n = n \ 2
NEXT j
PRINT s\$; " ";   ' binary notation
FOR p = 10 TO 2 STEP -1
IF MID\$(s\$, p - 1, 1) = "1" THEN
MID\$(s\$, p, 1) = LTRIM\$(STR\$(1 - VAL(MID\$(s\$, p, 1))))
END IF
NEXT   ' now it's gray code
PRINT s\$
FOR j = 1 TO 10
IF MID\$(s\$, j, 1) = "1" THEN PRINT #2, MID\$("abcdefghij", j, 1);
NEXT j
PRINT #2, "   ";
FOR j = 1 TO 10
IF MID\$(s\$, j, 1) = "0" THEN PRINT #2, MID\$("abcdefghij", j, 1);
NEXT j
PRINT #2,
NEXT
CLOSE

 Posted by Charlie on 2013-08-13 01:54:34 Please log in:

 Search: Search body:
Forums (2)
{"ft_lang_label":"__label__en","ft_lang_prob":0.80861044,"math_prob":0.9650155,"size":946,"snap":"2020-34-2020-40","text_gpt3_token_len":353,"char_repetition_ratio":0.12632696,"word_repetition_ratio":0.13861386,"special_character_ratio":0.42071882,"punctuation_ratio":0.1336207,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9668246,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T16:53:43Z\",\"WARC-Record-ID\":\"<urn:uuid:e77f675b-1e89-4196-b775-3a9c37be5b3d>\",\"Content-Length\":\"13046\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0fd0b3ef-5270-4230-aa42-6a9ee39ae33a>\",\"WARC-Concurrent-To\":\"<urn:uuid:17ad19ab-eaa6-4145-a04e-d23bad263eab>\",\"WARC-IP-Address\":\"216.67.228.67\",\"WARC-Target-URI\":\"http://perplexus.info/show.php?pid=8668&cid=51811\",\"WARC-Payload-Digest\":\"sha1:2ZMUS4IV4Z6CF6JWIWBYY2ENAFO7F2Q4\",\"WARC-Block-Digest\":\"sha1:SC7PBTOSF2RAISOPX7X3QTLR43MONFNR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735963.64_warc_CC-MAIN-20200805153603-20200805183603-00445.warc.gz\"}"}