Загрузка данных


Task 1
Let
\[
a=\sqrt{x-1},\qquad b=\sqrt{y-1}.
\]
The domain requires \(x,y\geq1\), so \(a,b\geq0\). Since \(x+y=10\),
\[
a^2+b^2=(x-1)+(y-1)=8.
\]
Also \(a+b=4\), so
\[
16=(a+b)^2=a^2+b^2+2ab=8+2ab,
\]
giving \(ab=4\). Thus \(a,b\) have sum \(4\) and product \(4\), so
\[
a=b=2.
\]
Therefore \(x=y=5\).
Check:
\[
5+5=10,\qquad \sqrt{5-1}+\sqrt{5-1}=2+2=4.
\]
The complete solution set is
\[
\{(5,5)\}.
\]
Swapping the coordinates does not produce a distinct ordered pair because both coordinates are equal.
Task 2
Let each letter also denote the truth value of that person's statement.
Since C says B is a liar,
\[
C=\neg B.
\]
Therefore exactly one of \(B,C\) is true, so A's statement is true:
\[
A=T.
\]
B's statement then says that \(D\) is also true, so \(B=D\). The total number of truth-tellers is consequently
\[
1+B+\neg B+D=2+D.
\]
If \(D=L\), exactly two people are truthful, making D's statement true, a contradiction. If \(D=T\), there are three truthful people, making D's statement false, also a contradiction.
Thus the set of consistent assignments is
\[
\varnothing.
\]
Task 3
The calls x = f(1), y = g(x), and z = f(2) all refer to the same default list. Its final contents are [1, 1, 2]. The explicit [] used for w creates a separate list.
The exact output is:
[1, 1, 2]
[1, 1, 2]
[1, 1, 2]
[3, 1]
True
True
False
Task 4
Conditioning on the uniformly selected child being a Tuesday-born boy gives no additional information about the independently generated sex of the other child. Therefore,
\[
P(\text{both boys}\mid\text{selected child is a Tuesday boy})=\frac12.
\]
This differs from the classic “at least one boy born on Tuesday” problem because selecting and observing a specific random child does not weight families according to how many Tuesday-born boys they contain, whereas conditioning on the family-level existence event does.
Task 5
A. The maximum number of outcome sequences is
\[
3^3=27.
\]
B. No. The count \(27\geq26\) is necessary as an information-capacity bound, but it does not by itself prove that available experiments can realize the required decision tree.
C. The permitted experiments might be unable to partition the hypotheses sufficiently evenly, or might always leave certain hypotheses observationally indistinguishable.
D. Yes. The balanced-partition assumption gives worst-case remaining-set sizes
\[
26\longrightarrow \left\lceil\frac{26}{3}\right\rceil=9
\longrightarrow \left\lceil\frac93\right\rceil=3
\longrightarrow \left\lceil\frac33\right\rceil=1.
\]
Thus after three experiments every leaf contains at most one hypothesis, so the hypothesis is determined.
Task 6
For odd \(n\), the optimal number of comparisons is
\[
\frac{3(n-1)}2,
\]
equivalently \(\lceil 3n/2\rceil-2\).
Algorithm: Pair \(n-1\) elements, leaving one unpaired. Compare each pair, using \((n-1)/2\) comparisons. Find the maximum among the pair winners and the unpaired element using \((n-1)/2\) more comparisons. Independently find the minimum among the pair losers and the unpaired element using another \((n-1)/2\).
The total is
\[
3\cdot\frac{n-1}{2}.
\]
For the lower bound, the standard comparison adversary requires every nonminimum element to be certified by a loss and every nonmaximum element by a win; only initial pairings can efficiently provide both kinds of certificates at once. This yields the general lower bound \(\lceil3n/2\rceil-2\), which is \(3(n-1)/2\) for odd \(n\).
Task 7
A. Under the standard sequential interpretation, if the merchant originally had \(x\) apples,
\[
x-\frac{x}{2}-6=10,
\]
so \(x=32\).
B. Different interpretations include:
- “Half my apples” could refer to half of a stock measured at some other relevant time, such as the current stock rather than the stock immediately before the first sale; that gives a different equation.
- The six apples could be included within, or clarify part of, the quantity described as “half,” rather than constituting an additional sale.
- The wording does not explicitly rule out purchases, returns, or other ordinary inventory changes between the sales and “now”; if those occurred, the original quantity is underdetermined.
C. Elementary algebra normally intends two consecutive sales from the same stock: first half of the original stock, then six additional apples.
Task 8
Subtracting the second equation from the first gives \(A-D=1\). Since both are binary,
\[
A=1,\qquad D=0.
\]
Then \(A+E=1\) gives \(E=0\). But \(C+D+E=2\) would then require \(C=2\), impossible for a binary variable.
Thus there are no solutions:
\[
\varnothing.
\]
The following five lines are the complete response to Task 9:
429
1AD
7
ROTANIMIRCSID
OK
Task 10
A. The function computes the insertion position immediately after all elements less than or equal to target. For a sorted list, this is the upper bound, or the index of the first element greater than target.
B. For a = [1] and target = 1, it returns 1, not the target's index 0.
C. A minimal correction using the existing upper-bound loop is:
def search(a, target):
    lo = 0
    hi = len(a)
    while lo < hi:
        mid = (lo + hi) // 2
        if a[mid] <= target:
            lo = mid + 1
        else:
            hi = mid
    return lo - 1 if lo > 0 and a[lo - 1] == target else -1
D. No. With duplicates, this version returns the last occurrence, not the first.
Task 11
Numbers congruent to \(5\pmod8\), considered modulo \(\operatorname{lcm}(4,6,8)=24\), are
\[
5,\ 13,\ 21\pmod{24}.
\]
Only \(21\) is congruent to \(3\pmod6\), and it is also congruent to \(1\pmod4\). Therefore the smallest positive solution is
\[
\boxed{21}.
\]
Indeed,
\[
21\equiv1\pmod4,\qquad 21\equiv3\pmod6,\qquad 21\equiv5\pmod8.
\]
Task 12
A. No. Exact equality over the real numbers does not imply equality after finite-precision binary representation and rounding.
B. Fractions such as \(0.1\), \(0.2\), and \(0.3\) generally have nonterminating binary expansions, so finite binary floating-point stores rounded approximations. Arithmetic introduces further rounding, and the approximation obtained by adding the stored values need not equal the stored approximation of the mathematical result.
C. No. Floating-point behavior is governed by deterministic representation and rounding rules; it is not random.
D. Use an error tolerance appropriate to the numerical scale, often combining absolute and relative tolerances, such as accepting values when
\[
|a-b|\leq \max(\varepsilon_{\mathrm{abs}},
\varepsilon_{\mathrm{rel}}\max(|a|,|b|)).
\]
Task 13
A. By the handshaking lemma,
\[
|E|=\frac{6\cdot3}{2}=9.
\]
B. Yes.
C. One example is \(K_{3,3}\), with partitions \(\{1,2,3\}\) and \(\{4,5,6\}\):
\[
\{(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)\}.
\]
Task 14
The minimum makespan is
\[
\boxed{13\text{ minutes}}.
\]
One schedule is:
Worker
1
2
All dependencies are satisfied. In particular, E starts only after B finishes at time 5 and C finishes at time 7.
No shorter schedule is possible because the dependency chain
\[
A\rightarrow C\rightarrow E
\]
has duration
\[
3+4+6=13.
\]
Therefore every valid schedule has makespan at least 13, and the displayed schedule attains that bound.
Task 15
NO.
The disease prevalence, or prior probability of disease in the tested population, is additionally needed.
Sensitivity specifies \(P(+\mid D)\), not \(P(D\mid+)\). The latter also depends on how frequently diseased and nondiseased people occur:
\[
P(D\mid+)=
\frac{P(+\mid D)P(D)}
{P(+\mid D)P(D)+P(+\mid\neg D)P(\neg D)}.
\]
Task 16
A. This is broken object-level authorization, commonly called BOLA or IDOR.
B. The missing invariant is that the authenticated user must be authorized to access the particular project identified by project_id, for example through project membership or an appropriately scoped administrative role.
C. Unpredictable UUIDs only make identifiers harder to guess. They do not enforce authorization, and IDs can still leak through URLs, logs, links, APIs, or other application data.
D. For every request, the server must verify that the authenticated principal has permission to read the requested project's membership data before returning it, and otherwise deny access.
Task 17
At recursion-tree level \(i\), there are \(2^i\) subproblems of size \(n/2^i\). Their combined nonrecursive work is
\[
2^i\left(\frac{n}{2^i}\log\frac{n}{2^i}\right)
=n(\log n-i).
\]
Summing over \(\Theta(\log n)\) levels gives
\[
n\sum_{j=1}^{\log n}j=\Theta(n\log^2 n).
\]
Hence
\[
\boxed{T(n)=\Theta(n\log^2 n)}.
\]
Task 18
The false-positive rate is \(1-0.95=0.05\). By Bayes' theorem,
\[
P(D\mid+)
=\frac{0.90(0.01)}
{0.90(0.01)+0.05(0.99)}
=\frac{0.009}{0.0585}
=\frac{2}{13}.
\]
To three significant figures,
\[
\boxed{P(D\mid+)\approx0.154}.
\]
Task 19
Under ordinary classical semantics, the imperative “you must answer TRUE” is not itself a truth-valued proposition. The remaining self-referential liar assertion cannot consistently be assigned either TRUE or FALSE: assigning TRUE makes its claim of falsity false, while assigning FALSE makes that claim true.
The phrase “you must answer TRUE” does not logically force the sentence's truth value; it is an instruction addressed to the respondent, not evidence that the sentence is true.
Task 20
A. The requests produce
\[
1+2=3,\qquad 3\cdot3=9,\qquad 9-4=5.
\]
The actual final value is \(5\), so the programmer's claim is correct.
B. Yes. Addition, multiplication, and subtraction in these compositions do not generally commute, so changing their order can change the result.
C. If Requests 2 and 3 swap order:
\[
1+2=3,\qquad 3-4=-1,\qquad (-1)\cdot3=-3.
\]
The final value is \(-3\).
Task 21
The constraints do not determine a unique true variable. There are two satisfying assignments:
- \(Q\) alone is true: \((P,Q,R,S)=(F,T,F,F)\).
- \(R\) alone is true: \((P,Q,R,S)=(F,F,T,F)\).
Thus the constraints are consistent, but either \(Q\) or \(R\) may be the unique true variable.
Task 22
No unique average can be computed. A probability distribution or relative frequency over inputs A and B is required, along with confirmation that these are the complete input population being averaged over.
If A occurs with probability \(p\) and B with probability \(1-p\), the expected runtime in milliseconds is
\[
p\cdot1+(1-p)\cdot1000.
\]
Task 23
No. There are \(2^{1000}\) possible 1000-bit inputs.
The number of binary output strings of length at most 999, including the empty string, is
\[
\sum_{k=0}^{999}2^k=2^{1000}-1.
\]
Thus there are fewer possible outputs than inputs. By the pigeonhole principle, two inputs would have to share an output, contradicting losslessness.
Task 24
Using
\[
a^3+b^3=(a+b)^3-3ab(a+b),
\]
we obtain
\[
a^3+b^3=7^3-3(12)(7)=343-252=\boxed{91}.
\]
Task 25
1. FALSE: An injective function need not cover its codomain; for example, \(f(n)=n+1\) on the nonnegative integers is injective but not surjective.
2. TRUE: For a finite set, an injective self-map has an image of the same cardinality as the entire set and is therefore surjective.
3. FALSE: Correlation alone does not establish causation and may arise from confounding or coincidence.
4. TRUE: If \(12\mid n\), then \(n=12k=6(2k)\), so \(6\mid n\).
5. FALSE: For example, 6 is divisible by 6 but not by 12.
6. FALSE: Authentication establishes identity, while authorization must separately permit access to the specific resource.
7. TRUE: With \(P(B)>0\), \(P(A\mid B)=P(A)\) implies \(P(A\cap B)=P(A)P(B)\), which is independence.
8. FALSE: A deterministic algorithm can follow different execution paths on equal-sized inputs and therefore take different amounts of time.
Task	Confidence
1	100/100
2	100/100
3	100/100
4	99/100
5	99/100
6	98/100
7	94/100
8	100/100
9	100/100
10	100/100
11	100/100
12	99/100
13	100/100
14	100/100
15	100/100
16	100/100
17	100/100
18	100/100
19	94/100
20	100/100
21	100/100
22	99/100
23	100/100
24	100/100
25	100/100
TOTAL_CONFIDENCE: 99/100
DISCRIMINATOR_COMPLETE