{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "feb04bbc",
   "metadata": {},
   "source": [
    "# 05-14 · gcd, lcm, silnia, comb, perm\n",
    "\n",
    "Praktyka do sekcji [«gcd, lcm, silnia, comb, perm»](/pl/chapters/rozdzial-05/05-14-gcd-lcm-faktorial.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7e6a0219",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Opanuj pięć funkcji math dla liczb całkowitych i liczenia wariacji."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2756eed7",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "54c2bf00",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:54.438613Z",
     "iopub.status.busy": "2026-08-16T12:02:54.438502Z",
     "iopub.status.idle": "2026-08-16T12:02:54.461823Z",
     "shell.execute_reply": "2026-08-16T12:02:54.461156Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6\n",
      "12\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "print(math.gcd(12, 18))\n",
    "print(math.lcm(4, 6))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b03fd45d",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "Porównaj comb() i perm() dla tych samych liczb."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4c9abd85",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:54.462807Z",
     "iopub.status.busy": "2026-08-16T12:02:54.462691Z",
     "iopub.status.idle": "2026-08-16T12:02:54.465781Z",
     "shell.execute_reply": "2026-08-16T12:02:54.465236Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15\n",
      "30\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "print(math.comb(6, 2))\n",
    "print(math.perm(6, 2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7eaab563",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Znajdź GCF(48, 18) i liczbę kombinacji od 6 do 2 – wypisz obie liczby oddzielone przestrzenią z jednym print() (oczekiwane `6 15`)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9ea8298d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:54.467391Z",
     "iopub.status.busy": "2026-08-16T12:02:54.467205Z",
     "iopub.status.idle": "2026-08-16T12:02:54.469916Z",
     "shell.execute_reply": "2026-08-16T12:02:54.469379Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6 15\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "print(math.gcd(48, 18), math.comb(6, 2))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
