# What's the randomness function of the Puzzle Swap piece-buyer?

I am curious to how Puzzle Swap decides which piece you get when you buy one. Does it:

• Pick a piece out of all the pieces?
• Pick a panel and then pick a piece for it?
• Pick whether the piece will be old or new and give a piece of that type?
• Something that makes even less sense?
-
By the way, the mathematical term for your “randomness function” is a (discrete) probability distribution. Your list of guesses looks good; they are all distinct distributions. – Kevin Reid May 31 '12 at 15:13
This question makes me wish I had started collecting data a few months ago when I wondered the same thing. – user2640 May 31 '12 at 17:03

I do not have any proof about the selection algorithm used (this may be impossible without seeing the source code), but when buying puzzle piece with Play Coins:

• You will never get a piece from a puzzle that you have completed.
• You will never get a piece from a puzzle that you haven't yet started.
• You will never get a StreetPass only piece (the pink ones).
• You may get a new piece.
• You may get a piece that you already have. (In fact, there's an Accomplishment gor getting 3 identical pieces in a row. This is easier to do to get if you only have 1 uncompleted puzzle, with a small number of pieces.)

Because of the puzzle exclusions (no pieces from completed or un-started puzzles), I would guess that completed and not started panels are first excluded from potential pool of new pices, and then StreetPass pieces are excluded. From the remaining pool of potential new pieces, you get one random piece.

-
You get a +1 for reasonable logic. – Toomai Jun 1 '12 at 3:07
I'd be curious if you can actually complete a panel with a bought piece. Has anyone had this happen? – Robotnik Jul 29 '13 at 5:39

I know that at least for three of the last four puzzles, and also for the mario kart 7 one, I always spent a round number of coins, because I only had them to get.

MK7, Mario Tennis Open and NSMB2 all cost exactly 200 play coins to get all 32 blue pieces. KIU cost 150.

The only exception was Kirby 20th. That was 186.

Ignoring the last one, I dont know of the rounded-to-50 figure was just coincidence, but I kind of figured the algorithm used a total of the number of coins they wanted you to spend then allocated a new piece at specific markers or percentages of that number or something.

I may be totally off...

-