random_choices
Select k items from a population with replacement, using optional weights for biased selection. Ideal for generating random samples from predefined item lists.
Instructions
Choose k items from population with replacement, optionally weighted.
Args: population: List of items to choose from k: Number of items to choose (default 1) weights: Optional weights for each item (default None for equal weights)
Returns: List of k chosen items
Input Schema
Name | Required | Description | Default |
---|---|---|---|
k | No | ||
population | Yes | ||
weights | No |