[{"data":1,"prerenderedAt":1131},["ShallowReactive",2],{"$fOFVeOAVQVINEYYVRHyPwv7guoKYQ2bpVNzmPKmDgJQQ":3,"$fMMUdSFktwQFqMVGPrTtt3EC5yheBp7PzwIqznamFcMo":108,"$fc0LoAJgqXDLbKKd2JS_NpM4SuzBK8EycUXINSg09CKU":111,"$fM3ea55k6lKMPOTM84llDB26VSQDVVbxiQuSBFQw9P_c":116,"$f1Prj1xEczHja_-L7FyIGgRHd5_cSWHo7r6AE5aheAik":461,"$fI5fDmvm-5tr9wcH0eHaKZa1j3y_FQIQaHHPqbZxAHJE":683,"mdc--dsszkt-key":703,"mdc-1i-key":715,"mdc-2f3-key":723,"mdc-2f9-key":731,"mdc-2in-key":739,"mdc--t1azug-key":747,"mdc--gwtztg-key":765,"mdc--o9g369-key":794,"mdc--ghsjoa-key":809,"mdc--r10105-key":858,"mdc--z0vb8p-key":875,"mdc-j1jnf0-key":907,"mdc-j9hh0n-key":915,"mdc-z0g5b3-key":1037,"mdc-7uib7c-key":1058,"mdc-fqpzpx-key":1066,"mdc-kl4rse-key":1084,"mdc-hxhohb-key":1107,"mdc--h113nn-key":1123},{"content":4,"quizQuestionContent":78,"type":97,"pageMeta":98},[5,9,13,16,20,23,27,31,34,37,41,44,48,51,55,58,62,65,69,72,75],{"id":6,"value":7,"isTypeH1":8},"1887","Сколько последовательностей существует из 5 бросков монеты",true,{"id":10,"value":11,"anchor":12,"isTypeH2":8},"4309","Теория: как считать число последовательностей","how-to-count-number-of-sequences",{"id":14,"value":15,"isTypeParagraph":8},"9918","Каждый результат эксперимента можно представить как строку длины 5, где на каждой позиции стоит один из двух символов: «О» (орёл) или «Р» (решка).  \nТребуется посчитать, сколько существует разных строк длины 5 над алфавитом из 2 символов.",{"id":17,"value":18,"anchor":19,"isTypeH3":8},"4320","Принцип умножения (правило произведения)","principle-of-multiplication",{"id":21,"value":22,"isTypeParagraph":8},"9919","В комбинаторике используется правило: если действие 1 можно выполнить A способами, после каждого из них действие 2 можно выполнить B способами, то пару действий можно выполнить A·B способами.\n\nВ данной задаче:\n- 1-й бросок: 2 варианта (О или Р)\n- 2-й бросок: 2 варианта (О или Р)\n- 3-й бросок: 2 варианта (О или Р)\n- 4-й бросок: 2 варианта (О или Р)\n- 5-й бросок: 2 варианта (О или Р)\n\nПо правилу произведения:\n2 · 2 · 2 · 2 · 2 = 2^5 = 32.",{"id":24,"description":25,"titleAlert":26,"isTypeAlertInfo":8},"619","Обобщение: при n бросках монеты число различных последовательностей равно `2^n`, потому что каждый новый бросок удваивает количество уже полученных вариантов.",null,{"id":28,"value":29,"anchor":30,"isTypeH3":8},"4321","Мини-проверка на малых n","small-n-check",{"id":32,"value":33,"isTypeParagraph":8},"9920","Для понимания полезно проверить несколько первых значений:\n- n = 1: (О, Р) → 2 варианта\n- n = 2: (ОО, ОР, РО, РР) → 4 варианта\n- n = 3: 8 вариантов\n\nНаблюдение: при добавлении ещё одного броска каждая существующая последовательность «продолжается» двумя способами (добавить О или Р), поэтому общее число вариантов каждый раз увеличивается в 2 раза.",{"id":35,"description":36,"titleAlert":26,"isTypeAlertWarning":8},"674","Возможная ошибка: иногда вместо «числа всех последовательностей» по ошибке ищется «число последовательностей с ровно k орлами». Это другая задача, там используются сочетания, а здесь требуется перечислить все возможные записи длины 5.",{"id":38,"value":39,"anchor":40,"isTypeH2":8},"4310","Таблица роста числа последовательностей","table-of-2-power-n",{"id":42,"value":43,"isTypeParagraph":8},"9921","| Число бросков n | Число последовательностей | Почему |\n|---:|---:|---|\n| 1 | 2 | О или Р |\n| 2 | 4 | 2·2 |\n| 3 | 8 | 2·2·2 |\n| 4 | 16 | 2^4 |\n| 5 | 32 | 2^5 |",{"id":45,"value":46,"anchor":47,"isTypeH2":8},"4311","Наглядная схема (дерево вариантов)","ascii-tree",{"id":49,"value":50,"isTypeParagraph":8},"9922","Идея дерева: на каждом шаге каждая ветка раздваивается (О или Р), поэтому число «листьев» (готовых последовательностей) после 5 шагов равно 32.\n\n```\nСтарт\n├─ О (1-й бросок)\n│  ├─ О (2-й)\n│  │  ├─ О (3-й)\n│  │  │  ├─ ...\n│  │  │  └─ ...\n│  │  └─ Р (3-й)\n│  │     ├─ ...\n│  │     └─ ...\n│  └─ Р (2-й)\n│     ├─ ...\n│     └─ ...\n└─ Р (1-й бросок)\n   ├─ О (2-й)\n   │  ├─ ...\n   │  └─ ...\n   └─ Р (2-й)\n      ├─ ...\n      └─ ...\n\nПосле n бросков количество листьев = 2^n.\n```\n",{"id":52,"value":53,"anchor":54,"isTypeH2":8},"4312","Пример на JavaScript: перечисление всех 32 строк","javascript-generate-sequences",{"id":56,"value":57,"isTypeParagraph":8},"9923","В web-разработке похожая логика встречается при генерации тестовых наборов, переборе вариантов и проверке граничных случаев.",{"id":59,"value":60,"anchor":61,"isTypeH3":8},"4322","Вариант 1: рекурсия","recursion-version",{"id":63,"value":64,"isTypeParagraph":8},"9924","Рекурсивный подход строит строки, постепенно добавляя символ, пока не получится длина 5.\n\n```\nfunction generateSequences(n, prefix = \"\", out = []) {\n  if (prefix.length === n) {\n    out.push(prefix);\n    return out;\n  }\n  generateSequences(n, prefix + \"О\", out);\n  generateSequences(n, prefix + \"Р\", out);\n  return out;\n}\n\nconst sequences = generateSequences(5);\nconsole.log(sequences.length); // 32\nconsole.log(sequences.slice(0, 10));\n```",{"id":66,"value":67,"anchor":68,"isTypeH3":8},"4323","Вариант 2: через битовую маску (двоичные числа)","bitmask-version",{"id":70,"value":71,"isTypeParagraph":8},"9925","Строке из О/Р можно сопоставить двоичное число из 5 бит: 0 → О, 1 → Р.  \nТогда все последовательности получаются перебором чисел от 0 до 31.\n\n```\nfunction generateByBits(n) {\n  const out = [];\n  const total = 1 \u003C\u003C n; // 2^n\n  for (let mask = 0; mask \u003C total; mask++) {\n    let s = \"\";\n    for (let i = n - 1; i >= 0; i--) {\n      const bit = (mask >> i) & 1;\n      s += bit === 0 ? \"О\" : \"Р\";\n    }\n    out.push(s);\n  }\n  return out;\n}\n\nconst sequences2 = generateByBits(5);\nconsole.log(sequences2.length); // 32\nconsole.log(sequences2[0], sequences2[31]); // ОOOOO и РRRRR (если считать 0->О, 1->Р)\n```",{"id":73,"description":74,"titleAlert":26,"isTypeAlertInfo":8},"620","Проверка корректности генератора: длина массива должна равняться `2^n`, а длина каждой строки — n.",{"id":76,"value":77,"isTypeParagraph":8},"9926","В итоге: при 5 бросках у каждого броска 2 исхода, поэтому общее число различных последовательностей равно 2^5 = 32, что соответствует варианту 4.",{"id":79,"options":80,"hint":94,"solution":95,"description":96},"1128",[81,85,88,91],{"id":82,"label":83,"isCorrect":84},"4639","6",false,{"id":86,"label":87,"isCorrect":84},"4640","10",{"id":89,"label":90,"isCorrect":84},"4641","16",{"id":92,"label":93,"isCorrect":8},"4642","32","Подсказка: каждый новый бросок удваивает количество возможных записей, поэтому ответ находится как `2^5`.","**Правильный ответ: 4** - 32, так как для `5` бросков число последовательностей равно `2^5`.","Есть монета. Ее подбрасывают пять раз подряд. Каждый раз записывается, что выпало - орел или решка. Сколько разных последовательностей орлов и решек может при этом получиться?","quizQuestion",{"title":99,"description":100,"ogTitle":99,"ogDescription":100,"ogImageUrl":101,"canonical":26,"ogLocale":102,"ogSiteName":103,"ogImageType":104,"ogImageWidth":105,"ogImageHeight":106,"ogType":107,"ogUrl":26},"Сколько последовательностей из 5 бросков монеты","Подсчёт числа исходов для 5 бросков: правило умножения, дерево исходов и связь с двоичными строками.","/og-image.png","ru_RU","goodwebjob.ru","image_jpeg","1200","630","article",{"siteName":109,"siteUrl":110},"GOOD WEB JOB!","https://goodwebjob.ru",[112],{"label":113,"slug":114,"to":115},"Подготовка к тех.интервью","technical-interview","/technical-interview/where-to-begin",{"navigationList":117,"navigationSublist":125},[118,121],{"path":115,"isActive":84,"name":119,"icon":120,"isNavbarMobileDisabled":8},"С чего начать?","material-symbols:visibility-outline-rounded",{"path":122,"isActive":8,"name":123,"icon":124,"isNavbarMobileDisabled":84},"/technical-interview/tasks","Сборник задач","material-symbols:task-outline",[126,135,162,174,180,321,345,354,360,423,444,450],{"title":127,"list":128,"isOpened":84},"Bash",[129,132],{"name":130,"path":131,"isActive":84},"Дан фрагмент bash-скрипта: cd ~; mkdir foo... Что в нем происходит?","/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":133,"path":134,"isActive":84},"Дан фрагмент bash-скрипта: target=$(ps -Af | grep $1 | head -n 1)...","/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"title":136,"list":137,"isOpened":84},"CSS",[138,141,144,147,150,153,156,159],{"name":139,"path":140,"isActive":84},"Дан HTML-код. Какой будет цвет у текста «Some dummy text»?","/technical-interview/tasks/the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":142,"path":143,"isActive":84},"Есть шаблон HTML и CSS кода. Какой будет цвет у текста «Таким образом, постоянное»?","/technical-interview/tasks/there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":145,"path":146,"isActive":84},"Есть шаблон вложенного HTML кода. Какой будет цвет у текста «One more dummy text»?","/technical-interview/tasks/there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":148,"path":149,"isActive":84},"Есть шаблон вложенного HTML кода. Будет ли display:block у body влиять на span?","/technical-interview/tasks/there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":151,"path":152,"isActive":84},"Есть HTML код. Будет ли font-weight на span влиять?","/technical-interview/tasks/there-is-an-html-code-will-font-weight-affect-span",{"name":154,"path":155,"isActive":84},"Flexbox и Grid, чем отличаются друг от друга?","/technical-interview/tasks/what-are-the-differences-between-flexbox-and-grid",{"name":157,"path":158,"isActive":84},"Заменяют ли Flexbox и Grid друг друга?","/technical-interview/tasks/do-flexbox-and-grid-replace-each-other",{"name":160,"path":161,"isActive":84},"Есть CSS и JS анимация. Какая между ними разница, что быстрее, что более удобно?","/technical-interview/tasks/there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"title":163,"list":164,"isOpened":84},"Git",[165,168,171],{"name":166,"path":167,"isActive":84},"Разрабатывал, взял закоммитил, запушил. Оказалось, что запушил не в ту ветку, точнее, коммит не в ту ветку. Какие действия?","/technical-interview/tasks/developed-it-committed-it-and-launched-it-it-turned-out-that-i-had-pushed-it-to-the-wrong-branch-or-rather-the-commit-was-in-the-wrong-branch-what-actions",{"name":169,"path":170,"isActive":84},"В git есть несколько вариантов слияния веток, какие? Чем отличаются?","/technical-interview/tasks/git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":172,"path":173,"isActive":84},"Какие существуют стратегии ветвления для работы команды? Что это такое?","/technical-interview/tasks/what-are-the-branching-strategies-for-the-team-what-is-it",{"title":175,"list":176,"isOpened":84},"HTML",[177],{"name":178,"path":179,"isActive":84},"Что такое HTML?","/technical-interview/tasks/what-is-html",{"title":181,"list":182,"isOpened":84},"JavaScript",[183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312,315,318],{"name":184,"path":185,"isActive":84},"Какие логические значения в console.log будут получены?","/technical-interview/tasks/prototype-what-logical-values-will-be-received-in-console-log",{"name":187,"path":188,"isActive":84},"Почему опасно писать прямо в прототипы базовых типов?","/technical-interview/tasks/why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":190,"path":191,"isActive":84},"Что вернёт следующий код? Object.create(null).hasOwnProperty('toString')","/technical-interview/tasks/what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":193,"path":194,"isActive":84},"Какое значение выведет консоль с object.property?","/technical-interview/tasks/what-value-will-the-console-output-with-object-property",{"name":196,"path":197,"isActive":84},"Что выведется в console.log([arr[0](), arr[0]()])?","/technical-interview/tasks/what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":199,"path":200,"isActive":84},"Что выведет console.log в результате выполнения цикла while?","/technical-interview/tasks/what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":202,"path":203,"isActive":84},"Есть функция и объект. Напишите все известные вам способы, чтобы вывести в консоли значение x из объекта, используя функцию","/technical-interview/tasks/there-is-a-function-and-an-object-write-all-the-ways-you-know-to-output-the-value-of-x-from-an-object-in-the-console-using-the-function",{"name":205,"path":206,"isActive":84},"Что вернёт метод book.getUpperName()?","/technical-interview/tasks/what-will-the-book-get-upper-name-method-return",{"name":208,"path":209,"isActive":84},"Переменные объявлены следующим образом: a=3; b=«hello»;. Укажите правильное утверждение","/technical-interview/tasks/variables-are-declared-as-follows-specify-the-correct-statement",{"name":211,"path":212,"isActive":84},"Что выведет консоль в случае присвоения свойства массиву по строковому положительному индексу?","/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":214,"path":215,"isActive":84},"Что выведет консоль в случае присвоения свойства массиву по строковому отрицательному индексу?","/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":217,"path":218,"isActive":84},"Что выведет консоль в случае удаления элемента массива с помощью оператора delete?","/technical-interview/tasks/what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":220,"path":221,"isActive":84},"Что вернёт этот код: typeof (function(){})()","/technical-interview/tasks/what-this-code-will-return-typeof-function",{"name":223,"path":224,"isActive":84},"Что получится в результате передачи объекта как аргумента в функцию и выполнения кода?","/technical-interview/tasks/what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":226,"path":227,"isActive":84},"Какие способы объявления функции есть в JavaScript?","/technical-interview/tasks/what-are-the-ways-to-declare-a-function-in-javascript",{"name":229,"path":230,"isActive":84},"Что такое this в JavaScript?","/technical-interview/tasks/what-is-this-in-javascript",{"name":232,"path":233,"isActive":84},"Что такое Event Loop, как работает?","/technical-interview/tasks/what-is-an-event-loop-and-how-does-it-work",{"name":235,"path":236,"isActive":84},"Что будет, если вызвать typeof на необъявленной переменной?","/technical-interview/tasks/what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":238,"path":239,"isActive":84},"Что показывает оператор typeof в JavaScript?","/technical-interview/tasks/what-does-the-typeof-operator-show-in-javascript",{"name":241,"path":242,"isActive":84},"Какие типы данных существует в JavaScript?","/technical-interview/tasks/what-types-of-data-exist-in-javascript",{"name":244,"path":245,"isActive":84},"Какую структуру использовать для хранения упорядоченного списка строк в JavaScript?","/technical-interview/tasks/what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":247,"path":248,"isActive":84},"Что вернет typeof для массива?","/technical-interview/tasks/what-will-typeof-return-for-an-array",{"name":250,"path":251,"isActive":84},"Почему оператор typeof, применённый к массиву, возвращает объект?","/technical-interview/tasks/why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":253,"path":254,"isActive":84},"Если нужно хранить список уникальных строк, какую структуру данных выбрать?","/technical-interview/tasks/if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":256,"path":257,"isActive":84},"Что возвращает typeof для new Set в JavaScript?","/technical-interview/tasks/what-does-typeof-return-for-new-set-in-javascript",{"name":259,"path":260,"isActive":84},"Почему в JavaScript два объекта с одинаковым содержимым при сравнении возвращают false?","/technical-interview/tasks/why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":262,"path":263,"isActive":84},"В чем разница между микро- и макро-тасками в JavaScript?","/technical-interview/tasks/what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":265,"path":266,"isActive":84},"arr.push(0) повлияет на массив так же, как если бы мы выполнили...","/technical-interview/tasks/arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":268,"path":269,"isActive":84},"Вернуть массив от 1 до n, где числа, кратные 3, заменены на 'fizz', кратные 5 - на 'buzz', а кратные и 3, и 5 одновременно - на 'fizzbuzz'","/technical-interview/tasks/returns-an-array-from-1-to-n-replacing-numbers-that-are-multiples-of-3-with-fizz-numbers-that-are-multiples-of-5-with-buzz-and-numbers-that-are-multiples-of-both-3-and-5-with-fizzbuzz",{"name":271,"path":272,"isActive":84},"Дана строка: 'one.two.three.four.five'. Необходимо из строки сделать вложенный объект","/technical-interview/tasks/the-string-one-two-three-four-five-is-given-it-is-necessary-to-make-a-nested-object-out-of-the-string",{"name":274,"path":275,"isActive":84},"Дано дерево (вложенный объект), надо найти сумму всех вершин","/technical-interview/tasks/given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":277,"path":278,"isActive":84},"Для каждого вложенного объекта нужно добавить свойство level, которое равняется числу - номер вложенности","/technical-interview/tasks/for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":280,"path":281,"isActive":84},"Для каждой ветви дерева записать номер вложенности данной ветви","/technical-interview/tasks/for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":283,"path":284,"isActive":84},"Есть массив, в котором лежат объекты с датами, необходимо отсортировать даты по возрастанию","/technical-interview/tasks/there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":286,"path":287,"isActive":84},"Есть слова в массиве, необходимо определить, состоят ли они из одних и тех же букв","/technical-interview/tasks/there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":289,"path":290,"isActive":84},"Есть строка, состоящая из разных скобок, необходимо проверить, закрыты ли все","/technical-interview/tasks/there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":292,"path":293,"isActive":84}," Найти в массиве неповторяющиеся числа","/technical-interview/tasks/find-non-repeating-numbers-in-an-array",{"name":295,"path":296,"isActive":84},"Напишите функцию, который сделает из массива объект","/technical-interview/tasks/write-a-function-that-will-make-an-object-out-of-an-array",{"name":298,"path":299,"isActive":84},"Необходимо проверить, являются ли две строки анаграммами друг друга","/technical-interview/tasks/checks-whether-two-strings-are-anagrams-of-each-other",{"name":301,"path":302,"isActive":84},"Нечётные числа должны отсортироваться по возрастанию, а чётные должны остаться на своих местах","/technical-interview/tasks/odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":304,"path":305,"isActive":84},"Определить, является ли слово палиндромом","/technical-interview/tasks/determines-whether-a-word-is-a-palindrome",{"name":307,"path":308,"isActive":84},"«Расплющивание» массива","/technical-interview/tasks/flattening-the-array",{"name":310,"path":311,"isActive":84},"Реализовать функцию, принимающую аргументы \"*\", \"1\", \"b\", \"1c\" и возвращающую строку \"1*b*1c\"","/technical-interview/tasks/implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":313,"path":314,"isActive":84},"Сжатие строк","/technical-interview/tasks/string-compression",{"name":316,"path":317,"isActive":84},"Уникализация значений в массиве","/technical-interview/tasks/unifying-values-in-an-array",{"name":319,"path":320,"isActive":84},"Числа от 1 до 100 находятся в массиве, они хаотично перемешанные, но в нём не хватает одного числа из этой последовательности. Необходимо найти его","/technical-interview/tasks/the-numbers-from-1-to-100-are-in-the-array-they-are-randomly-mixed-but-it-lacks-one-number-from-this-sequence-it-is-necessary-to-find-him",{"title":322,"list":323,"isOpened":84},"React",[324,327,330,333,336,339,342],{"name":325,"path":326,"isActive":84},"Для чего нужен React, какие он решает проблемы?","/technical-interview/tasks/what-is-react-used-for-and-what-problems-does-it-solve",{"name":328,"path":329,"isActive":84},"Какой механизм лежит в основе оптимизации обновлений DOM в React?","/technical-interview/tasks/what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":331,"path":332,"isActive":84},"Если убрать в React VDOM/Fiber, и вручную изменять DOM, разве это не оптимально?","/technical-interview/tasks/if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":334,"path":335,"isActive":84},"Есть блок кода. Что в реальном DOM изменится после нажатия на кнопку?","/technical-interview/tasks/there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":337,"path":338,"isActive":84},"Есть код, в котором список и кнопка. Что в реальном DOM изменится после нажатия на кнопку?","/technical-interview/tasks/there-is-a-code-in-which-there-is-a-list-and-a-button-what-will-change-in-the-real-dom-after-clicking-on-the-button",{"name":340,"path":341,"isActive":84},"Зачем нужен Redux (Mobx/Effector)? Зачем нужен менеджер состояния? Какие проблемы решает?","/technical-interview/tasks/why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":343,"path":344,"isActive":84},"Что мешает организовать централизованное состояние без менеджера состояния? Если организовать состояние механизмами реакта: контекстом, стейтом, в чем проблема? Что менеджеры состояния привносят?","/technical-interview/tasks/what-prevents-you-from-organizing-a-centralized-state-without-a-state-manager-if-you-organize-the-state-using-react-context-and-state-mechanisms-what-is-the-problem-what-do-state-managers-add",{"title":346,"list":347,"isOpened":84},"Алгоритмы",[348,351],{"name":349,"path":350,"isActive":84},"Что такое алгоритмическая сложность?","/technical-interview/tasks/what-is-algorithmic-complexity",{"name":352,"path":353,"isActive":84},"Какая алгоритмическая сложность у \"быстрой сортировки\"?","/technical-interview/tasks/what-is-the-algorithmic-complexity-of-quick-sort",{"title":355,"list":356,"isOpened":84},"Дебаггинг",[357],{"name":358,"path":359,"isActive":84},"Как диагностировать и исправить нежелательное изменение цвета фона по клику на кнопку, если исходный код сайта запутан и недоступен для прямого чтения?","/technical-interview/tasks/how-can-diagnose-and-fix-unwanted-background-color-changes-when-clicking-on-a-button-if-the-source-code-of-the-site-is-confusing-and-inaccessible-to-direct-reading",{"title":361,"list":362,"isOpened":84},"Компьютерные сети",[363,366,369,372,375,378,381,384,387,390,393,396,399,402,405,408,411,414,417,420],{"name":364,"path":365,"isActive":84},"Как браузер после ввода домена понимает, откуда брать сайт?","/technical-interview/tasks/how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":367,"path":368,"isActive":84},"Что такое DNS, как DNS находит нужный IP-адрес?","/technical-interview/tasks/what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":370,"path":371,"isActive":84},"Как домен попадает в DNS в таблицу соответствия: домен – ip","/technical-interview/tasks/how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":373,"path":374,"isActive":84},"Как браузер решает, какое соединение ему открывать, TCP или UDP?","/technical-interview/tasks/how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":376,"path":377,"isActive":84},"Ключевые отличия TCP и UDP","/technical-interview/tasks/key-differences-between-tcp-and-udp",{"name":379,"path":380,"isActive":84},"\"TCP/IP\" - кем является TCP, а кем IP в данном случае?","/technical-interview/tasks/tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":382,"path":383,"isActive":84},"Что такое HTTP и из чего состоит?","/technical-interview/tasks/what-is-http-and-what-does-it-consist-of",{"name":385,"path":386,"isActive":84},"Что такое заголовки в HTTP и зачем они нужны?","/technical-interview/tasks/what-are-http-headers-and-why-do-we-need-them",{"name":388,"path":389,"isActive":84},"Что такое параметры в HTTP?","/technical-interview/tasks/what-are-http-parameters",{"name":391,"path":392,"isActive":84},"Где находится HTML-код в структуре HTTP-ответа?","/technical-interview/tasks/where-is-the-html-code-located-in-the-http-response-structure",{"name":394,"path":395,"isActive":84},"Чем отличаются 1.0, 1.1, 2.0, 3.0 версии HTTP?","/technical-interview/tasks/what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":397,"path":398,"isActive":84},"Пользователь авторизован на сайте. Как сервер узнает об этом с последующими другими заходами, что «я – авторизованный пользователь»?","/technical-interview/tasks/the-user-is-logged-in-on-the-website-how-does-the-server-know-that-i-am-an-authorized-user-when-the-user-logs-in-again",{"name":400,"path":401,"isActive":84},"Что такое cookie?","/technical-interview/tasks/what-is-a-cookie",{"name":403,"path":404,"isActive":84},"Кто является инициатором записи cookie в браузере?","/technical-interview/tasks/who-initiates-the-cookie-recording-in-the-browser",{"name":406,"path":407,"isActive":84},"Есть ли возможность с клиента (с браузера) управлять cookie?","/technical-interview/tasks/is-it-possible-to-manage-cookies-from-the-client-browser",{"name":409,"path":410,"isActive":84},"Верно ли утверждение, что злоумышленник, контролирующий роутер и прослушивающий трафик, может получить логины и пароли от сайтов, на которые заходит клиент?","/technical-interview/tasks/is-it-true-that-an-attacker-who-controls-a-router-and-listens-to-traffic-can-obtain-logins-and-passwords-from-websites-that-a-client-visits",{"name":412,"path":413,"isActive":84},"Всё, что идет по HTTPS – оно защищено?","/technical-interview/tasks/is-everything-that-goes-through-https-secure",{"name":415,"path":416,"isActive":84},"Все данные зашифрованы, используется https. Хакер взламывает dns и делает подмену одного ip на другой, на фишинговый сайт. В этом случае, злоумышленник может получить данные (логин \\ пароль)?","/technical-interview/tasks/all-data-is-encrypted-https-is-used-let-s-assume-a-hacker-hacks-the-dns-and-makes-a-substitution-of-one-ip-for-another-a-phishing-site",{"name":418,"path":419,"isActive":84},"Есть веб-приложение. Помимо HTTP, какие протоколы того же уровня (Application Layer) можно дополнительно использовать в веб-приложении в браузере?","/technical-interview/tasks/there-is-a-web-application-in-addition-to-http-what-other-protocols-of-the-same-level-application-layer-can-be-used-in-the-web-application-in-browser",{"name":421,"path":422,"isActive":84},"Каким способом может выполняться авторизация пользователя на сайте?","/technical-interview/tasks/how-can-a-user-be-authorized-on-a-website",{"title":424,"list":425,"isOpened":84},"Отрисовка в браузере",[426,429,432,435,438,441],{"name":427,"path":428,"isActive":84},"Что происходит, когда HTTP прислал HTML? Что браузер дальше делает c HTML с учетом того, что она валидная?","/technical-interview/tasks/what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":430,"path":431,"isActive":84},"Как браузер парсит JavaScript и изображения при рендеринге?","/technical-interview/tasks/how-the-browser-parses-javascript-and-images-when-rendering",{"name":433,"path":434,"isActive":84},"Что в браузере блокирует рендеринг страницы?","/technical-interview/tasks/what-is-blocking-the-page-rendering-in-the-browser",{"name":436,"path":437,"isActive":84},"Что такое DOM в браузере? Что такое CSSOM?","/technical-interview/tasks/what-is-dom-in-a-browser-what-is-cssom",{"name":439,"path":440,"isActive":84},"Что является узлами в DOM?","/technical-interview/tasks/what-are-nodes-in-the-dom",{"name":442,"path":443,"isActive":84},"Из чего состоит CSSOM?","/technical-interview/tasks/what-does-cssom-consist-of",{"title":445,"list":446,"isOpened":84},"Ревью кода",[447],{"name":448,"path":449,"isActive":84},"По каким характеристикам, ревьюер понимает, что данный код - хороший, а этот код - плохой?","/technical-interview/tasks/how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"title":451,"list":452,"isOpened":84},"Теория вероятности",[453,456,458],{"name":454,"path":455,"isActive":84},"В комнате три человека. Какова вероятность того, что хотя бы двое из них одного пола? То есть два и более.","/technical-interview/tasks/there-are-three-people-in-the-room-what-is-the-probability-that-at-least-two-of-them-are-of-the-same-sex-that-is-two-or-more",{"name":96,"path":457,"isActive":84},"/technical-interview/tasks/there-is-a-coin-it-is-tossed-five-times-in-a-row-each-time-it-is-recorded-whether-it-lands-on-heads-or-tails-how-many-different-sequences-of-heads-and-tails-can-be-obtained",{"name":459,"path":460,"isActive":84},"Как гарантированно найти лёгкую фальшивую монету среди 8 за минимальное число взвешиваний на чашечных весах?","/technical-interview/tasks/how-can-you-guarantee-to-find-an-easy-fake-coin-among-8-in-the-minimum-number-of-weighings-on-a-balance-scale",{"slugs":462},[463,466,468,470,472,475,478,480,482,484,486,488,491,493,495,497,499,501,503,505,507,509,511,513,515,517,519,521,523,525,527,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,563,565,567,569,572,574,576,578,580,582,584,586,588,590,592,594,596,598,600,602,604,606,608,610,612,614,616,618,620,622,624,626,628,630,632,634,636,638,640,642,644,646,648,650,652,654,656,658,660,662,664,666,668,670,672,673,675,677,679,681],{"name":464,"value":465},"Теоретические задания","theoretical-tasks",{"name":220,"value":467},"what-this-code-will-return-typeof-function",{"name":119,"value":469},"where-to-begin",{"name":187,"value":471},"why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":473,"value":474},"Backend","backend",{"name":476,"value":477},"Frontend","frontend",{"name":184,"value":479},"prototype-what-logical-values-will-be-received-in-console-log",{"name":301,"value":481},"odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":292,"value":483},"find-non-repeating-numbers-in-an-array",{"name":265,"value":485},"arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":271,"value":487},"the-string-one-two-three-four-five-is-given-it-is-necessary-to-make-a-nested-object-out-of-the-string",{"name":489,"value":490},"Реализовать функцию, похоже как в Jquery","implement-a-function-similar-to-jquery",{"name":277,"value":492},"for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":193,"value":494},"what-value-will-the-console-output-with-object-property",{"name":196,"value":496},"what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":268,"value":498},"returns-an-array-from-1-to-n-replacing-numbers-that-are-multiples-of-3-with-fizz-numbers-that-are-multiples-of-5-with-buzz-and-numbers-that-are-multiples-of-both-3-and-5-with-fizzbuzz",{"name":298,"value":500},"checks-whether-two-strings-are-anagrams-of-each-other",{"name":304,"value":502},"determines-whether-a-word-is-a-palindrome",{"name":283,"value":504},"there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":310,"value":506},"implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":274,"value":508},"given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":280,"value":510},"for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":286,"value":512},"there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":319,"value":514},"the-numbers-from-1-to-100-are-in-the-array-they-are-randomly-mixed-but-it-lacks-one-number-from-this-sequence-it-is-necessary-to-find-him",{"name":289,"value":516},"there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":295,"value":518},"write-a-function-that-will-make-an-object-out-of-an-array",{"name":199,"value":520},"what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":202,"value":522},"there-is-a-function-and-an-object-write-all-the-ways-you-know-to-output-the-value-of-x-from-an-object-in-the-console-using-the-function",{"name":214,"value":524},"what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":217,"value":526},"what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":316,"value":528},"unifying-values-in-an-array",{"name":307,"value":530},"flattening-the-array",{"name":205,"value":532},"what-will-the-book-get-upper-name-method-return",{"name":313,"value":534},"string-compression",{"name":211,"value":536},"what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":223,"value":538},"what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":364,"value":540},"how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":370,"value":542},"how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":373,"value":544},"how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":376,"value":546},"key-differences-between-tcp-and-udp",{"name":379,"value":548},"tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":382,"value":550},"what-is-http-and-what-does-it-consist-of",{"name":385,"value":552},"what-are-http-headers-and-why-do-we-need-them",{"name":388,"value":554},"what-are-http-parameters",{"name":391,"value":556},"where-is-the-html-code-located-in-the-http-response-structure",{"name":178,"value":558},"what-is-html",{"name":394,"value":560},"what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":397,"value":562},"the-user-is-logged-in-on-the-website-how-does-the-server-know-that-i-am-an-authorized-user-when-the-user-logs-in-again",{"name":400,"value":564},"what-is-a-cookie",{"name":403,"value":566},"who-initiates-the-cookie-recording-in-the-browser",{"name":406,"value":568},"is-it-possible-to-manage-cookies-from-the-client-browser",{"name":570,"value":571},"Лайвкодинг","livecoding",{"name":190,"value":573},"what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":412,"value":575},"is-everything-that-goes-through-https-secure",{"name":415,"value":577},"all-data-is-encrypted-https-is-used-let-s-assume-a-hacker-hacks-the-dns-and-makes-a-substitution-of-one-ip-for-another-a-phishing-site",{"name":418,"value":579},"there-is-a-web-application-in-addition-to-http-what-other-protocols-of-the-same-level-application-layer-can-be-used-in-the-web-application-in-browser",{"name":430,"value":581},"how-the-browser-parses-javascript-and-images-when-rendering",{"name":427,"value":583},"what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":433,"value":585},"what-is-blocking-the-page-rendering-in-the-browser",{"name":436,"value":587},"what-is-dom-in-a-browser-what-is-cssom",{"name":439,"value":589},"what-are-nodes-in-the-dom",{"name":442,"value":591},"what-does-cssom-consist-of",{"name":139,"value":593},"the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":142,"value":595},"there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":145,"value":597},"there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":148,"value":599},"there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":151,"value":601},"there-is-an-html-code-will-font-weight-affect-span",{"name":154,"value":603},"what-are-the-differences-between-flexbox-and-grid",{"name":157,"value":605},"do-flexbox-and-grid-replace-each-other",{"name":160,"value":607},"there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"name":123,"value":609},"tasks",{"name":226,"value":611},"what-are-the-ways-to-declare-a-function-in-javascript",{"name":229,"value":613},"what-is-this-in-javascript",{"name":232,"value":615},"what-is-an-event-loop-and-how-does-it-work",{"name":235,"value":617},"what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":238,"value":619},"what-does-the-typeof-operator-show-in-javascript",{"name":241,"value":621},"what-types-of-data-exist-in-javascript",{"name":244,"value":623},"what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":247,"value":625},"what-will-typeof-return-for-an-array",{"name":250,"value":627},"why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":253,"value":629},"if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":256,"value":631},"what-does-typeof-return-for-new-set-in-javascript",{"name":325,"value":633},"what-is-react-used-for-and-what-problems-does-it-solve",{"name":331,"value":635},"if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":334,"value":637},"there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":337,"value":639},"there-is-a-code-in-which-there-is-a-list-and-a-button-what-will-change-in-the-real-dom-after-clicking-on-the-button",{"name":340,"value":641},"why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":358,"value":643},"how-can-diagnose-and-fix-unwanted-background-color-changes-when-clicking-on-a-button-if-the-source-code-of-the-site-is-confusing-and-inaccessible-to-direct-reading",{"name":166,"value":645},"developed-it-committed-it-and-launched-it-it-turned-out-that-i-had-pushed-it-to-the-wrong-branch-or-rather-the-commit-was-in-the-wrong-branch-what-actions",{"name":169,"value":647},"git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":172,"value":649},"what-are-the-branching-strategies-for-the-team-what-is-it",{"name":448,"value":651},"how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"name":130,"value":653},"here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":133,"value":655},"here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"name":349,"value":657},"what-is-algorithmic-complexity",{"name":352,"value":659},"what-is-the-algorithmic-complexity-of-quick-sort",{"name":259,"value":661},"why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":421,"value":663},"how-can-a-user-be-authorized-on-a-website",{"name":262,"value":665},"what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":454,"value":667},"there-are-three-people-in-the-room-what-is-the-probability-that-at-least-two-of-them-are-of-the-same-sex-that-is-two-or-more",{"name":96,"value":669},"there-is-a-coin-it-is-tossed-five-times-in-a-row-each-time-it-is-recorded-whether-it-lands-on-heads-or-tails-how-many-different-sequences-of-heads-and-tails-can-be-obtained",{"name":459,"value":671},"how-can-you-guarantee-to-find-an-easy-fake-coin-among-8-in-the-minimum-number-of-weighings-on-a-balance-scale",{"name":113,"value":114},{"name":409,"value":674},"is-it-true-that-an-attacker-who-controls-a-router-and-listens-to-traffic-can-obtain-logins-and-passwords-from-websites-that-a-client-visits",{"name":367,"value":676},"what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":208,"value":678},"variables-are-declared-as-follows-specify-the-correct-statement",{"name":328,"value":680},"what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":343,"value":682},"what-prevents-you-from-organizing-a-centralized-state-without-a-state-manager-if-you-organize-the-state-using-react-context-and-state-mechanisms-what-is-the-problem-what-do-state-managers-add",{"cooperation":684,"copyright":687,"reportError":688,"socialNetwork":690},{"link":685,"title":686},"https://t.me/baurinanton","Сотрудничество","© “GOOD WEB JOB!”",{"label":689,"link":685},"Сообщить об ошибке",{"label":691,"socialNetworkList":692},"Мы в соцсетях:",[693,696,699],{"icon":26,"link":694,"title":695},"https://max.ru/u/f9LHodD0cOKMaukdnnahTeL5pwvjrPfUaZ4S8_1rsNy9I9qsmc9Ar3kP_y8","Max",{"icon":697,"link":685,"title":698},"ic:baseline-telegram","Telegram",{"icon":700,"link":701,"title":702},"ri:vk-fill","https://vk.com/baurinanton","VK",{"data":704,"body":705},{},{"type":706,"children":707},"root",[708],{"type":709,"tag":710,"props":711,"children":712},"element","p",{},[713],{"type":714,"value":96},"text",{"data":716,"body":717},{},{"type":706,"children":718},[719],{"type":709,"tag":710,"props":720,"children":721},{},[722],{"type":714,"value":83},{"data":724,"body":725},{},{"type":706,"children":726},[727],{"type":709,"tag":710,"props":728,"children":729},{},[730],{"type":714,"value":87},{"data":732,"body":733},{},{"type":706,"children":734},[735],{"type":709,"tag":710,"props":736,"children":737},{},[738],{"type":714,"value":90},{"data":740,"body":741},{},{"type":706,"children":742},[743],{"type":709,"tag":710,"props":744,"children":745},{},[746],{"type":714,"value":93},{"data":748,"body":749},{},{"type":706,"children":750},[751],{"type":709,"tag":710,"props":752,"children":753},{},[754,756,763],{"type":714,"value":755},"Подсказка: каждый новый бросок удваивает количество возможных записей, поэтому ответ находится как ",{"type":709,"tag":757,"props":758,"children":760},"code",{"className":759},[],[761],{"type":714,"value":762},"2^5",{"type":714,"value":764},".",{"data":766,"body":767},{},{"type":706,"children":768},[769],{"type":709,"tag":710,"props":770,"children":771},{},[772,778,780,786,788,793],{"type":709,"tag":773,"props":774,"children":775},"strong",{},[776],{"type":714,"value":777},"Правильный ответ: 4",{"type":714,"value":779}," - 32, так как для ",{"type":709,"tag":757,"props":781,"children":783},{"className":782},[],[784],{"type":714,"value":785},"5",{"type":714,"value":787}," бросков число последовательностей равно ",{"type":709,"tag":757,"props":789,"children":791},{"className":790},[],[792],{"type":714,"value":762},{"type":714,"value":764},{"data":795,"body":796},{},{"type":706,"children":797},[798],{"type":709,"tag":710,"props":799,"children":800},{},[801,803,807],{"type":714,"value":802},"Каждый результат эксперимента можно представить как строку длины 5, где на каждой позиции стоит один из двух символов: «О» (орёл) или «Р» (решка).",{"type":709,"tag":804,"props":805,"children":806},"br",{},[],{"type":714,"value":808},"\nТребуется посчитать, сколько существует разных строк длины 5 над алфавитом из 2 символов.",{"data":810,"body":811},{},{"type":706,"children":812},[813,818,823,853],{"type":709,"tag":710,"props":814,"children":815},{},[816],{"type":714,"value":817},"В комбинаторике используется правило: если действие 1 можно выполнить A способами, после каждого из них действие 2 можно выполнить B способами, то пару действий можно выполнить A·B способами.",{"type":709,"tag":710,"props":819,"children":820},{},[821],{"type":714,"value":822},"В данной задаче:",{"type":709,"tag":824,"props":825,"children":826},"ul",{},[827,833,838,843,848],{"type":709,"tag":828,"props":829,"children":830},"li",{},[831],{"type":714,"value":832},"1-й бросок: 2 варианта (О или Р)",{"type":709,"tag":828,"props":834,"children":835},{},[836],{"type":714,"value":837},"2-й бросок: 2 варианта (О или Р)",{"type":709,"tag":828,"props":839,"children":840},{},[841],{"type":714,"value":842},"3-й бросок: 2 варианта (О или Р)",{"type":709,"tag":828,"props":844,"children":845},{},[846],{"type":714,"value":847},"4-й бросок: 2 варианта (О или Р)",{"type":709,"tag":828,"props":849,"children":850},{},[851],{"type":714,"value":852},"5-й бросок: 2 варианта (О или Р)",{"type":709,"tag":710,"props":854,"children":855},{},[856],{"type":714,"value":857},"По правилу произведения:\n2 · 2 · 2 · 2 · 2 = 2^5 = 32.",{"data":859,"body":860},{},{"type":706,"children":861},[862],{"type":709,"tag":710,"props":863,"children":864},{},[865,867,873],{"type":714,"value":866},"Обобщение: при n бросках монеты число различных последовательностей равно ",{"type":709,"tag":757,"props":868,"children":870},{"className":869},[],[871],{"type":714,"value":872},"2^n",{"type":714,"value":874},", потому что каждый новый бросок удваивает количество уже полученных вариантов.",{"data":876,"body":877},{},{"type":706,"children":878},[879,884,902],{"type":709,"tag":710,"props":880,"children":881},{},[882],{"type":714,"value":883},"Для понимания полезно проверить несколько первых значений:",{"type":709,"tag":824,"props":885,"children":886},{},[887,892,897],{"type":709,"tag":828,"props":888,"children":889},{},[890],{"type":714,"value":891},"n = 1: (О, Р) → 2 варианта",{"type":709,"tag":828,"props":893,"children":894},{},[895],{"type":714,"value":896},"n = 2: (ОО, ОР, РО, РР) → 4 варианта",{"type":709,"tag":828,"props":898,"children":899},{},[900],{"type":714,"value":901},"n = 3: 8 вариантов",{"type":709,"tag":710,"props":903,"children":904},{},[905],{"type":714,"value":906},"Наблюдение: при добавлении ещё одного броска каждая существующая последовательность «продолжается» двумя способами (добавить О или Р), поэтому общее число вариантов каждый раз увеличивается в 2 раза.",{"data":908,"body":909},{},{"type":706,"children":910},[911],{"type":709,"tag":710,"props":912,"children":913},{},[914],{"type":714,"value":36},{"data":916,"body":917},{},{"type":706,"children":918},[919],{"type":709,"tag":920,"props":921,"children":922},"table",{},[923,948],{"type":709,"tag":924,"props":925,"children":926},"thead",{},[927],{"type":709,"tag":928,"props":929,"children":930},"tr",{},[931,938,943],{"type":709,"tag":932,"props":933,"children":935},"th",{"align":934},"right",[936],{"type":714,"value":937},"Число бросков n",{"type":709,"tag":932,"props":939,"children":940},{"align":934},[941],{"type":714,"value":942},"Число последовательностей",{"type":709,"tag":932,"props":944,"children":945},{},[946],{"type":714,"value":947},"Почему",{"type":709,"tag":949,"props":950,"children":951},"tbody",{},[952,971,988,1006,1022],{"type":709,"tag":928,"props":953,"children":954},{},[955,961,966],{"type":709,"tag":956,"props":957,"children":958},"td",{"align":934},[959],{"type":714,"value":960},"1",{"type":709,"tag":956,"props":962,"children":963},{"align":934},[964],{"type":714,"value":965},"2",{"type":709,"tag":956,"props":967,"children":968},{},[969],{"type":714,"value":970},"О или Р",{"type":709,"tag":928,"props":972,"children":973},{},[974,978,983],{"type":709,"tag":956,"props":975,"children":976},{"align":934},[977],{"type":714,"value":965},{"type":709,"tag":956,"props":979,"children":980},{"align":934},[981],{"type":714,"value":982},"4",{"type":709,"tag":956,"props":984,"children":985},{},[986],{"type":714,"value":987},"2·2",{"type":709,"tag":928,"props":989,"children":990},{},[991,996,1001],{"type":709,"tag":956,"props":992,"children":993},{"align":934},[994],{"type":714,"value":995},"3",{"type":709,"tag":956,"props":997,"children":998},{"align":934},[999],{"type":714,"value":1000},"8",{"type":709,"tag":956,"props":1002,"children":1003},{},[1004],{"type":714,"value":1005},"2·2·2",{"type":709,"tag":928,"props":1007,"children":1008},{},[1009,1013,1017],{"type":709,"tag":956,"props":1010,"children":1011},{"align":934},[1012],{"type":714,"value":982},{"type":709,"tag":956,"props":1014,"children":1015},{"align":934},[1016],{"type":714,"value":90},{"type":709,"tag":956,"props":1018,"children":1019},{},[1020],{"type":714,"value":1021},"2^4",{"type":709,"tag":928,"props":1023,"children":1024},{},[1025,1029,1033],{"type":709,"tag":956,"props":1026,"children":1027},{"align":934},[1028],{"type":714,"value":785},{"type":709,"tag":956,"props":1030,"children":1031},{"align":934},[1032],{"type":714,"value":93},{"type":709,"tag":956,"props":1034,"children":1035},{},[1036],{"type":714,"value":762},{"data":1038,"body":1039},{},{"type":706,"children":1040},[1041,1046],{"type":709,"tag":710,"props":1042,"children":1043},{},[1044],{"type":714,"value":1045},"Идея дерева: на каждом шаге каждая ветка раздваивается (О или Р), поэтому число «листьев» (готовых последовательностей) после 5 шагов равно 32.",{"type":709,"tag":1047,"props":1048,"children":1052},"pre",{"className":1049,"code":1051,"language":714},[1050],"language-text","Старт\n├─ О (1-й бросок)\n│  ├─ О (2-й)\n│  │  ├─ О (3-й)\n│  │  │  ├─ ...\n│  │  │  └─ ...\n│  │  └─ Р (3-й)\n│  │     ├─ ...\n│  │     └─ ...\n│  └─ Р (2-й)\n│     ├─ ...\n│     └─ ...\n└─ Р (1-й бросок)\n   ├─ О (2-й)\n   │  ├─ ...\n   │  └─ ...\n   └─ Р (2-й)\n      ├─ ...\n      └─ ...\n\nПосле n бросков количество листьев = 2^n.\n",[1053],{"type":709,"tag":757,"props":1054,"children":1056},{"__ignoreMap":1055},"",[1057],{"type":714,"value":1051},{"data":1059,"body":1060},{},{"type":706,"children":1061},[1062],{"type":709,"tag":710,"props":1063,"children":1064},{},[1065],{"type":714,"value":57},{"data":1067,"body":1068},{},{"type":706,"children":1069},[1070,1075],{"type":709,"tag":710,"props":1071,"children":1072},{},[1073],{"type":714,"value":1074},"Рекурсивный подход строит строки, постепенно добавляя символ, пока не получится длина 5.",{"type":709,"tag":1047,"props":1076,"children":1079},{"className":1077,"code":1078,"language":714},[1050],"function generateSequences(n, prefix = \"\", out = []) {\n  if (prefix.length === n) {\n    out.push(prefix);\n    return out;\n  }\n  generateSequences(n, prefix + \"О\", out);\n  generateSequences(n, prefix + \"Р\", out);\n  return out;\n}\n\nconst sequences = generateSequences(5);\nconsole.log(sequences.length); // 32\nconsole.log(sequences.slice(0, 10));\n",[1080],{"type":709,"tag":757,"props":1081,"children":1082},{"__ignoreMap":1055},[1083],{"type":714,"value":1078},{"data":1085,"body":1086},{},{"type":706,"children":1087},[1088,1098],{"type":709,"tag":710,"props":1089,"children":1090},{},[1091,1093,1096],{"type":714,"value":1092},"Строке из О/Р можно сопоставить двоичное число из 5 бит: 0 → О, 1 → Р.",{"type":709,"tag":804,"props":1094,"children":1095},{},[],{"type":714,"value":1097},"\nТогда все последовательности получаются перебором чисел от 0 до 31.",{"type":709,"tag":1047,"props":1099,"children":1102},{"className":1100,"code":1101,"language":714},[1050],"function generateByBits(n) {\n  const out = [];\n  const total = 1 \u003C\u003C n; // 2^n\n  for (let mask = 0; mask \u003C total; mask++) {\n    let s = \"\";\n    for (let i = n - 1; i >= 0; i--) {\n      const bit = (mask >> i) & 1;\n      s += bit === 0 ? \"О\" : \"Р\";\n    }\n    out.push(s);\n  }\n  return out;\n}\n\nconst sequences2 = generateByBits(5);\nconsole.log(sequences2.length); // 32\nconsole.log(sequences2[0], sequences2[31]); // ОOOOO и РRRRR (если считать 0->О, 1->Р)\n",[1103],{"type":709,"tag":757,"props":1104,"children":1105},{"__ignoreMap":1055},[1106],{"type":714,"value":1101},{"data":1108,"body":1109},{},{"type":706,"children":1110},[1111],{"type":709,"tag":710,"props":1112,"children":1113},{},[1114,1116,1121],{"type":714,"value":1115},"Проверка корректности генератора: длина массива должна равняться ",{"type":709,"tag":757,"props":1117,"children":1119},{"className":1118},[],[1120],{"type":714,"value":872},{"type":714,"value":1122},", а длина каждой строки — n.",{"data":1124,"body":1125},{},{"type":706,"children":1126},[1127],{"type":709,"tag":710,"props":1128,"children":1129},{},[1130],{"type":714,"value":77},1775735658928]