<![CDATA[Programmer's Town - Etudes for Programmers]]>
http://www.progtown.com/
Wed, 15 Aug 2018 07:00:00 +0000PunBB<![CDATA[Probability of two children]]>
http://www.progtown.com/topic2098187-probability-of-two-children.html
You live in the street where only two houses. You live in one, in other there lives the neighbor with the wife. You left in expedition for 10 years. While you were on expedition, you receive the letter from the neighbor that at it now two children. Having returned from expedition, you find out the boy playing near the house of the neighbor. You are assured that it is one of children of the neighbor. What probability, what the second child at the neighbor too the son?]]>Wed, 15 Aug 2018 07:00:00 +0000http://www.progtown.com/topic2098187-probability-of-two-children.html<![CDATA[We throw a coin]]>
http://www.progtown.com/topic2095549-we-throw-a-coin.html
threw a coin of 10 times. And Petja of 11 times. What probability of what at Petja a coin falls out an eagle more than at Vasi? We consider that at a throw the probability of drop - out of an eagle and is identical.]]>Wed, 18 Jul 2018 04:25:00 +0000http://www.progtown.com/topic2095549-we-throw-a-coin.html<![CDATA[Re: Pythagorea]]>
http://www.progtown.com/topic2095551-re-pythagorea.html
Tue, 17 Jul 2018 04:55:00 +0000http://www.progtown.com/topic2095551-re-pythagorea.html<![CDATA[Legible lines]]>
http://www.progtown.com/topic2095552-legible-lines.html
All greetings. There is such task: it is required to find an amount of lines of length n (n <= 100) which do not comprise repetitions of length from 1 to k (1 <= k <= 9) over the given alphabet from and letters (1 <= a <= 26). As tandemnym repetition is called the line of a type ww where w is some sequence of letters (in this sequence from 1 to k letters). There will be ideas?]]>Sun, 15 Jul 2018 09:02:00 +0000http://www.progtown.com/topic2095552-legible-lines.html<![CDATA[Magic age]]>
http://www.progtown.com/topic2093053-magic-age.html
Good afternoon, dear colleagues! Today at me If my age to write down in the form of a decimal number we receive certain number. Then - we change digit places. We receive the correct value of my age in a hexadecimal type. A question: how many years to me knocked today? P.S. It is desirable to show the code (in any language known to you), proving your case.]]>Wed, 20 Jun 2018 07:08:00 +0000http://www.progtown.com/topic2093053-magic-age.html<![CDATA[Positive thinking in the language theory]]>
http://www.progtown.com/topic2090516-positive-thinking-in-the-language-theory.html
Drinking ~ = the nondrinker the smoker ~ =???]]>Thu, 03 May 2018 01:09:00 +0000http://www.progtown.com/topic2090516-positive-thinking-in-the-language-theory.html<![CDATA[Problem on]]>
http://www.progtown.com/topic2088982-problem-on.html
There was a problem on after the first usage of this. The problem such to create a folder with ` * ` characters and `. ` Can even in cygwin or here try: https://www.tutorialspoint.com/execute_bash_online.php (!) the Help: I not the user of Linux, in the Windows core, therefore at me turned out from the first. It not a problem on first of April though to it becomes.]]>Sun, 01 Apr 2018 07:33:00 +0000http://www.progtown.com/topic2088982-problem-on.html<![CDATA[Such here the task]]>
http://www.progtown.com/topic2088983-such-here-the-task.html
There is arbitrary a lambda-expression. About it a lambda-expression it is known that in it there can be function invocations F (x). And calls can meet some times, and there can be calls the same arguments. About function F (x) it is known that it works "slowly enough" if to cause it with the same arguments will always return identical result. The task: to make optimization initial a lambda-expression, that is to get rid of identical function invocations F (x). An example. On an input expression: (int x, int y) => F (x)> F (y)? F (x): (F (x) <F (2*y)? F (2*y): F (y)) On an output: the Lambda-expression which do preliminary calculation of parameters: var p1 = (int x) => F (x); var p2 = (int y) => F (y); var p3 = (int y) => F (2*y); and the optimized expression: (p1, p2, p3) => p1> p2? p1: (p1 <p3? p3: p2) It is required to create function of the optimized expression evaluation of a type: OptimizedCalculation (lambda, lambdaParams, functionF) {var optimized = OptimizeLambda (lambda, functionF); var result = CalculateLambda (optimized, lambdaParams); return result;} That is at first optimization, then calculation is fulfilled. I ask to consider that initial the lambda-expression can have absolutely arbitrary form. As function F can have absolutely arbitrary appearance and a dial-up of parameters.]]>Wed, 28 Mar 2018 06:53:00 +0000http://www.progtown.com/topic2088983-such-here-the-task.html<![CDATA[Re: to hang up an ex-fur-tree]]>
http://www.progtown.com/topic2088008-re-to-hang-up-an-exfurtree.html
Hello, Kodt, you wrote: Cast https://pikabu.ru/story/exel_veshaet_nout_5801336 What maximum computing complexity it is possible to organize on ? ("From a box", without macroes) If at us is N cells with formulas what most fierce update is possible at change of value of one cell? Exponential A1=a A2= (A1; "a"; "aa") A2... To fill downwards (Ctrl+D) the Linear complexity: each following cell depends on a constant amount of the previous. Square: depends on all previous (for example, the total on a column above). By the way, whether and the ex-fur-tree recognizes such formulas and whether the total? Who is more?]]>Mon, 26 Mar 2018 03:49:00 +0000http://www.progtown.com/topic2088008-re-to-hang-up-an-exfurtree.html<![CDATA[Question on a cube of Rubika]]>
http://www.progtown.com/topic2086285-question-on-a-cube-of-rubika.html
How many the minimum of edges of a cube needs to be seen unambiguously to recover a configuration of all cube? Disassembled, certainly.]]>Mon, 12 Mar 2018 04:01:00 +0000http://www.progtown.com/topic2086285-question-on-a-cube-of-rubika.html<![CDATA[Re: a tendency, however!]]>
http://www.progtown.com/topic2086287-re-a-tendency-however.html
Hello, Kodt, you wrote: If to consider a constant tendency how many deer will fall from a breakaway during the following, well we tell, 5 minutes? 8+16+32+64+128=248?]]>Mon, 26 Feb 2018 18:33:00 +0000http://www.progtown.com/topic2086287-re-a-tendency-however.html<![CDATA[Re: three]]>
http://www.progtown.com/topic2086289-re-three.html
Why it is the rectilinear approach does not work? Still as works, if we after speed do not pursue. It is stupid to place 3 figures in each cell in 4 orientations and to check that gets out, and that is superimposed. (40*4 ^3 variants of layouts, on each 7*3 checks, only 86 016 000 operations. Well let each check is 20 instructions and instructions not always on one clock period At clock frequency of 3 gigahertz is 1760 / 3000 seconds, i.e. it is less than second.]]>Mon, 26 Feb 2018 13:34:00 +0000http://www.progtown.com/topic2086289-re-three.html<![CDATA[Comparing of two lines with even and odd swaps]]>
http://www.progtown.com/topic2083941-comparing-of-two-lines-with-even-and-odd-swaps.html
There are two lines. We consider that they are equal in a case if there is a dial-up of operations on transformation of one of a line in another. Accessible operations of transformation it is swap by places of odd characters in line. The second operation swap by places of even characters. How to solve? I have a decision, but probably will be correct it in the end to tell. As though you solved?]]>Fri, 16 Feb 2018 15:31:00 +0000http://www.progtown.com/topic2083941-comparing-of-two-lines-with-even-and-odd-swaps.html<![CDATA[Triangle from stick slices]]>
http://www.progtown.com/topic2083943-triangle-from-stick-slices.html
At once I am sorry, if a bayan. Today set a problem, very much it was pleasant. A direct stick in a random way break in two places. What probability of that from the received slices it is possible to add a triangle. Allocation of probability of position of fractures on length of a stick to consider as uniform.]]>Tue, 13 Feb 2018 18:09:00 +0000http://www.progtown.com/topic2083943-triangle-from-stick-slices.html<![CDATA[QR-code]]>
http://www.progtown.com/topic2083944-qrcode.html
It is not assured that it here was, and is not assured that it for programmers. But to backs. We imagine that we develop the standard of a QR-code. Our QR-code of the size NxN is a small square from N x N pixels. Each pixel black or white. Difficulty consists that when we scan the code, we do not know, what side turns a square. 4 variants (0, 90, 180 and 270 degrees) the Question are possible all: how many different unique numbers it is possible to encode such code so, what the read out number did not depend on square orientation.]]>Fri, 09 Feb 2018 01:27:00 +0000http://www.progtown.com/topic2083944-qrcode.html