Re: How: {{a,b},{1,2,3}} --> {{a,1},{b,2},{a,3}} ?

• To: mathgroup at smc.vnet.net
• Subject: [mg14310] Re: How: {{a,b},{1,2,3}} --> {{a,1},{b,2},{a,3}} ?
• From: Hans Staugaard <hans.staugaard at get2net.dk>
• Date: Tue, 13 Oct 1998 01:21:25 -0400
• Organization: Tele2 Internet Kunde
• References: <6vf5es\$dha@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Michael Kubovy wrote:
>
> How do I get from {{a,b},{1,2,3}} to {{a,1},{b,2},{a,3}} ?
>
> Thanks,
> |\  /|  / Michael Kubovy, Professor of Psychology, Dept of Psychology |
> \/ | /  Univ of Virginia, Gilmer Hall, Charlottesville, VA 22903-2477 |
> |/\  office (B011): 804-982-4729, lab (B019): -4751, fax: -4766  |    |
> \ HTTP://www.virginia.edu/~mklab/

I am not sure what you mean, but here is my intepretation of the
question:
Given a list containing list, form `mathcing' tuples, if a list runs
out,
cycle from beginning.
First i define a function pad:

Take[Flatten[Table[v,{Ceiling[n/Length[v]]}]],n] /; n>Length[v]
v /; n=Length[v]

and then

maketuples[m:{{__}..}]:=