This problem from IMO 2019 (international maths olympiad) was surprisingly easier than expected.
Find all functions $f: Z \to Z$ such that
$$ f(2a) + 2f(b) = f(f(a+b)) \quad \quad \forall a,b \in Z$$
$Z$ is the set of integers.
math and bridge hands and computer science and programming and puzzles and etc and etc.
This problem from IMO 2019 (international maths olympiad) was surprisingly easier than expected.
Find all functions $f: Z \to Z$ such that
$$ f(2a) + 2f(b) = f(f(a+b)) \quad \quad \forall a,b \in Z$$
$Z$ is the set of integers.
Find all non-negative integers $a, b$ such that
$$ \sqrt{a} + \sqrt{b} = \sqrt{2019}$$
A cute problem from the Indian national Math Olympiad (of 2011 I believe).
Find all real $(x,y)$ such that
$$16^{x^2 + y} + 16^{y^2 + x} = 1 $$
I think it is from the French Olympiad, not sure.
$x, y$ are positive reals. Show that
$$ x^y + y^x \ge 1$$
This mainly deals with bidding, which is rare for this blog.
All white, IMPS. You hold AKJTx, AQx, AJ, KJx
Solid partner opens 4H in first seat and RHO passes. You decide slam is odds on, and trot out keycard blackwood.
Partner shows one keycard. You decide to bid 6H and LHO doubles (lead directing). You take this out to 6NT and LHO doubles again.
Will you redouble?
You must!
You expect this partner to have the HK and LHO to have CA. LHO is unlikely to have the HK (because the double of 6NT will be risky).
If partner has SQ and HK 6NT is cold. If partner does not have the SQ, then RHO is very likely to have it! Why? LHOs double of 6H is likely based on a spade void. So if partner has a doubleton spade, 6NT is cold.
So assume partner has a singleton spade. If LHO has DKQ and CA, then you go down 1 at most.
If partner has CQ and diamond K, Q are split, then on the expected non-diamond lead you can setup 5 black suit tricks.
If partner has DQ and LHO has DK and CA (likely based on double of 6NT), then you have a strip squeeze endplay against LHO.
It is very unlikely you will go down more than 1, so you must redouble!
At the table 6NT was redoubled and made when partner had a doubleton spade and HK and LHO indeed had a spade void.
Our teammates were surprised to win 11 IMPS after a coming back with -1100 in 6CX-5!
It was an exciting slam to bid as you played it during the bidding itself (so I kind of lied that this is bidding only :-)).
| IMPS None | Dummy ♠ 32 ♥ KJ87 ♦ AJ ♣ KQJT9 | |
| You ♠ AKJT98 ♥ 65 ♦ KQ2 ♣ A2 |
| IMPS None | Dummy ♠ AKJT98 ♥ 65 ♦ KQ2 ♣ A2 | |
| You ♠ 32 ♥ KJ87 ♦ AJ ♣ KQJT9 |
| W | N | E | S |
|---|---|---|---|
| 1NT | |||
| P | 4Hxfr | P | 4S |
| P | 4NT | P | 5C |
| P | 6S |
# Given bitstream (base 2 representation) generates random bit with
# pbt of 0 = number represented by bitstream.
def random_bit_base2(bias_bitstream, fair_random_bit):
# We generate a random number and if < given number
# return 0, else return 1.
for bit in bias_bitstream():
fair_bit = fair_random_bit()
# the number represented by the fair_bit seq is different!
if fair_bit != bit:
# This basically is returning 0
# if number formed by fair_bit seq < bitstream seq.
# else returning 1.
return fair_bit
# Given digits in factorial base
# i.e num = \sum_{n=2}^{\infty} d_n/n!
# Generate a random bit with probability num.
def random_bit_base_factorial(digit_stream, fair_random_int):
# We generate a random number and if < given number
# return 0, else return 1.
base = 2
# We generate a random digit (0, ..., base - 1)
# and then increment the base.
for digit in digit_stream():
fair_digit = fair_random_int(base)
base = base + 1
if fair_digit < digit:
return 0
if fair_digit > digit:
return 1
1. Add root to tree.
2. Pick an existing node in the tree randomly that has child space
2.1 Randomly add a child node to it.
3. Continue till tree has n nodes.
for (int i = 0; i < array.length; i++) {
int r = random(array.length); // random position where ith card goes.
swap(array, i, r); // Swap a[i] and a[r]
}
Why is this not uniform? The random number generator only generates probability $\frac{1}{n}$. The number of permutations is $n!$ and we can never achieve $\frac{1}{n!}$ no matter how we combine those $\frac{1}{n}$s (for $n \gt 2$).
do {
int bit1 = random_bit();
int bit2 = random_bit();
int result = bit1 + 2*bit2;
if (result < 3) return result; //0, 1 or 2.
} while (true);
This generates a number in $\{0, 1, 2\}$ with probability $\frac{1}{3}$, even though the random number calls only generates probabilities of $\frac{1}{2}$ (the random bit calls).