169 похожих чатов

Frontend JS Algorithms If we are presented with the first

k terms of a sequence it is impossible to say with certainty the
value of the next term, as there are infinitely many polynomial functions that can model the
sequence.
As an example, let us consider the sequence of cube numbers. This is defined by the generating
function,
un = n3
: 1, 8, 27, 64, 125, 216, ...
Suppose we were only given the first two terms of this sequence. Working on the principle that
"simple is best" we should assume a linear relationship and predict the next term to be 15 (common
difference 7). Even if we were presented with the first three terms, by the same principle of
simplicity, a quadratic relationship should be assumed. We shall define OP (k, n) to be the nth term
of the optimum polynomial generating function for the first k terms of a sequence. It should be
clear that OP (k, n) will accurately generate the terms of the sequence for n ≤ k, and potentially
the first incorrect term (FIT) will be OP (k, k + 1); in which case we shall call it a bad OP (BOP) .As
a basis, if we were only given the first term of sequence, it would be most sensible to assume
constancy; that is, for n ≥ 2, OP (1, n) = u1.
Hence we obtain the following OPs for the cubic sequence:
OP (1, n) = 1
1, 1, 1, 1, ...
OP (2, n) = 7n − 6
1, 8, 15, ...
OP (3, n) = 6n2
−11n + 6
1, 8, 27, 58, ...
OP (4, n) = n3
1, 8, 27, 64, 125, ...
Clearly no BOPs exist for k ≥ 4.
By considering the sum of FITs generated by the BOPs (indicated in red above), we obtain 1 + 15
+ 58 = 74.
Consider the following tenth degree polynomial generating function:
un = 1 - n + n2 - n3 + n4 - n5 + n6 - n7 + n8 - n9 + n10
Find the sum of FITs for the BOPs.
Deadline: 3 days from today
Submission criteria: github, clean and clear code
есть кто понял задачу?

1 ответов

7 просмотров

судя по всему просят предугадать формулу по введённому ряду и вернуть генератор. если ввели всего одно число, то очевидно что генератор будет выводить только это число если ввели 1, 2 - генератор должен предугадать, что следующие числа 3,4 если ввели 1, 2, 4 - генератор должен уже придумать что нибудь поинтереснее, по типу 7, 11 в качестве следующих элементов. n2, n3 - это номера генерируемых значений. Просят посчитать un = 1 - n + n2 - n3 + n4 - n5 + n6 - n7 + n8 - n9 + n10

Похожие вопросы

Обсуждают сегодня

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
32
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Книга Юрова В.И пойдёт для обучения?
Botsman
24
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
> Примечательно, что новый владелец удаляет из GitHub любые жалобы, указывающие на подозрительную активность или смену владельца, и, видимо, рассчитывает на то, что пользовате...
Alex Sherbakov
1
Hey there Which is the best Linux destro for developers (coding)? To my research on reddit, they said Linux mint is good for mid level spec and Ubuntu for high Lev hardwar...
Wiz 🪄
11
И ещё вопрос: можно ли типа как на дос как-то запариться и с помощью прерываний выводить текст, вместо функции printf ?
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
34
а мы ещё не созрели до того, чтобы создать отдельный чатик про настройку редакторов?
Cheese Syrowiecki
16
Всем привет! У меня почему-то по-разному отображается TListView в Debug и Release режимах (FireMonkey)! При запуске под Win приложения TListView заливается программо. в Debug ...
Александр COM
8
Ладно, ещё тупого спрошу. Код должен банально вывести значение регистра на консоль, на деле же не выводя ничего, просто оставляя нерабочую консоль (открыта, ничего не написан...
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
25
Карта сайта