[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 290

 
Mathemat >>:

А, ну да, йопт :) Черт, иногда очевидного не вижу.

А с твоим скриптом что-то подозрительное. Посмотрим.

:)

My script gets it right. But don't feel bad - it's not optimal either :)

You don't need to make a prime numbers table, the function checking for prime numbers was enough.

And this table appeared historically - when I thought of building a tree of variants, not to recalculate the prime repeatedly.

So it appeared in the project. And it remains so, even when the project was simplified and the need in repeated access to the table disappeared. :)

//Waaaah... There's just a lot of trash left over there. Declaration of an unused structure

// struct NumStruct
// {
// bool Simple;
// double P;
// };

 
In a certain city, only paired flat exchanges are allowed.
If two families exchange flats, they do not participate in other exchanges on the same day.
Prove that any complex multi-family flat exchange can be done in two days.
(Assume that both before and after the exchange, each family lives in a separate flat.
 
MetaDriver >>:
В некотором городе разрешены только парные обмены квартирами.
Если две семьи обмениваются квартирами, то в тот же день они не участвуют в других обменах.
Докажите, что любой сложный обмен квартирами нескольких семей можно осуществить за два дня.
(Предполагаем, что и до, и после обмена каждая семья живёт в отдельной квартире.)


Either I'm stupid, or why can't I have one?
 
Mischek >>:
Либо я туплю,либо почему за один нельзя ?

Let's look at the conditions: In a certain city,only paired flat exchanges are allowed.

// This does not mean that I approve of such legislation. I could invite "flat swap defenders" to a rally. It'll be very friendly. :)

 
MetaDriver >>:

Смотрим условия: В некотором городе разрешены только парные обмены квартирами.

// Это не значит, что я одобряю подобное законодательство. Могу пригласить на митинг "защитников прав квартирообменщиков". Будет очень дружно. :)



Shit )
--------------------------

"I am Shvonder, she is Vyazemskaya, Comrade Zhirovkin and Comrade Pestrukhin..." (c)
 
Mischek >>:
" Я Швондер,она Вяземская, товарищ Жировкин и товарищ Пеструхин..." (с)

:)

 
Give the definition of a complex exchange, MetaDriver.
Let the families F = {f1, f2, f3, ... fn}. Each of them corresponds to K = {k1, k2, ..., kn} flats in the same order. A complex exchange is such a rearrangement of flats K1 = T(K), in which none of them is in the same place. Will this work?
If yes, you can probably handle it by induction.
 
Mathemat >>:
Давай определение сложного обмена, MetaDriver.
Пусть даны семьи F = {f1, f2, f3, ... fn}. Каждой из них в том же порядке соответствуют квартиры K = {k1, k2, ..., kn}. Сложный обмен - это такая перестановка квартир К1 = T(K), при которой ни одна из них не находится на прежнем месте. Так пойдет?
Если да, то тут, наверно, можно индукцией справиться.

There is no definition in the problem. This time it's someone else's problem, I didn't risk making it up myself. :)

 
Tex. This thread is dead. While we're trying to solve the flat swap problem, I'll propose another one:

And here's another paradoxical one:
 
can any of the experts answer a simple question - what is a hut on chicken legs?
Reason: