benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 809ecadf-57fd-5be7-b9d7-2295294c563a

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import numpy as np
import math
import random
from random import uniform


def task_func(radius, num_points):
    """
    Create a tuple with a list of random points within a circle of a given radius.
    
    Parameters:
    - radius (int): The radius of the circle.
    - num_points (int): The number of points to be generated.

    Returns:
    - out (list): A list of points within a circle.

    Requirements:
    - numpy
    - math
    - random

    Example:
    >>> random.seed(42)
    >>> task_func(1, 3)
    [(-0.10124546928297637, -0.12149119380571095), (-0.07399370924760951, 0.46662154808860146), (-0.06984148700093858, -0.8196472742078809)]
    """

instruct prompt

Create a tuple with a list of random points within a circle of a given radius.
The function should output with:
    out (list): A list of points within a circle.
You should write self-contained code starting with:

Code

import numpy as np
import math
import random
from random import uniform
def task_func(radius, num_points):

code prompt

Code

import numpy as np
import math
import random
from random import uniform
def task_func(radius, num_points):

entry point

task_func

libs

  • math
  • numpy
  • random

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import