string $objects[] = `listRelatives -type "transform" -pa "yourGroup"`; // FIRST GET OBJECTS IN GROUP
int $num = size($objects); // NUMBER OF OBJECTS
float $percent = 50.0; // NOW SET YOUR PERCENTAGE OF OBJECTS TO SELECT
int $numToSelect = ($percent/100.0) * $num; // ACTUAL NUMBER OF OBJECTS TO SELECT
// USE A RANDOM NUMBER FUNCTION TO DETERMINE IF AN OBJECT IS SELECTED OR NOT
float $threshold = $percent/100.0; // SINCE THIS EXAMPLE USES 50%, A THRESHOLD OF .5 IS USED
string $list[]; // RECORD THE OBJECTS TO SELECT
while(size($list) < $numToSelect) // KEEP SELECTING UNTIL DESIRED PERCENTAGE IS ACHIEVED
{
for($object in $objects) // LOOP THROUGH YOUR OBJECTS TO DETERMINE WHICH ARE SELECTED
{
if(rand(1) > $threshold)
$list[size($list)] = $object;
}
$objects = stringArrayRemove($list, $objects); // REMOVE SELECTED OBJECTS FROM YOUR ORIGINAL LIST
}
This was typed without trying it in Maya. But the logic is there. And I'm pretty sure it will work. Using a "while" conditional is always hazardous, but in this case, you will eventually hit your percentage so it shouldn't go into an endless loop. Good luck.