- 20,634
- 27,796
You cannot define "west" at the south pole.
Same is supposed to hold for "5km towards south" (at southpole)?fresh_42 said:You cannot define "west" at the south pole.
Yes. That's why we have to circle the south pole.SSequence said:Same is supposed to hold for "5km towards south" (at southpole)?
for i in range(9999999, 99999999):
if i%36 == 0:
if(len(set(str(i))))==8:
print(i)
#!/usr/bin/perl
for ($a=10000000;$a<100000000;$a++) {
($a % 36 ==0) && (scalar(do{my %s; grep {!$s{$_}++} ("$a" =~ /(\d)/g) }) == 8 ) && last;
}
print "$a=36x", $a/36;
Let's limit the playing field: 'connected' does not mean 'with a common point', but 'with a common side' and stacking is not allowed. If that's correct, then I doodlefresh_42 said:104. How many different (connected) plane figures can be created with five squares?
I think we should skip the symmetries of our polyominoes, e.g. 2-5, 3-4. I should have said it, sorry.BvU said:Let's limit the playing field: 'connected' does not mean 'with a common point', but 'with a common side' and stacking is not allowed. If that's correct, then I doodle
fresh_42 said:111. Between 10 and 100 people are present at a party. Some leave early. At the end of the party, everyone present shakes hands with everyone else. Overall, there were exactly half the number of handshakes as if all party guests had stayed until the end.
How many people were present at the party? How many left early?
D114
#!/usr/bin/perl
#
use strict;
my @triangle;
for ( my $i=1; $i<=100; $i++ ) {
$triangle[$i] = $i * ($i-1) / 2;
if ( $i >= 10 ) {
for ( my $j=1; $j<$i; $j++ ) {
if ( 2 * $triangle[$j] == $triangle[$i] ) {
print "Answer is: $i, ", $i-$j, "\n";
print "There were ", $triangle[$i], " handshakes before the people left and ", $triangle[$j], " after\n";
};
};
};
};
After two days, the ratio is the middle 2 on line 3 to the 1 on line 1.
After four days, the ratio is the middle 6 on line 6 to the 2 on line 3. etc.
[john.d.briggs@nhnaunxlfapb001 ~]$ ./test.pl
After 2 days ratio is 2
After 4 days ratio is 3
After 6 days ratio is 3.33333333333333
After 8 days ratio is 3.5
After 10 days ratio is 3.6
After 12 days ratio is 3.66666666666667
After 14 days ratio is 3.71428571428571
After 16 days ratio is 3.75
After 18 days ratio is 3.77777777777778
After 20 days ratio is 3.8
Probability of landing at starting spot after 20 days is 0.176197052001953
Probability of landing at starting spot after 18 days is 0.185470581054688
Of course, there is also an easy exact solution. Just calculate ##P(n)## and solve ##\dfrac{P(n)}{P(n-2)}=0.95\,.##jbriggs444 said:We are looking at the middle terms in binomial distributions. We want the middle terms in two successive rows with an odd number of terms, one of which is to be 95% of the other.
Naturally, since the totals for a binomial distribution double at each step, this will mean that the term from the latter row will actually be 4*.95 = 3.8 times that in the previous.
I will brute-force it with Pascal's triangle and trust double precision float to be adequate. [The evaluation order leads to fairly well-conditioned arithmetic and the floating point range will not be stressed, though precision will].
e.g.
Code:After two days, the ratio is the middle 2 on line 3 to the 1 on line 1. After four days, the ratio is the middle 6 on line 6 to the 2 on line 3. etc. [john.d.briggs@nhnaunxlfapb001 ~]$ ./test.pl After 2 days ratio is 2 After 4 days ratio is 3 After 6 days ratio is 3.33333333333333 After 8 days ratio is 3.5 After 10 days ratio is 3.6 After 12 days ratio is 3.66666666666667 After 14 days ratio is 3.71428571428571 After 16 days ratio is 3.75 After 18 days ratio is 3.77777777777778 After 20 days ratio is 3.8 Probability of landing at starting spot after 20 days is 0.176197052001953 Probability of landing at starting spot after 18 days is 0.185470581054688
This is so much easier than what I was trying. I was trying to run enough simulations to satisfy the 95% using the incomplete gamma function and whatnot.fresh_42 said:Of course, there is also an easy exact solution. Just calculate ##P(n)## and solve ##\dfrac{P(n)}{P(n-2)}=0.95\,.##
These can only be morphed into one another if you allow a third dimension... a restriction I stuck to and I should have mentioned (i.e. I consider a lefthand glove different from a righthand glove)fresh_42 said:I think we should skip the symmetries of our polyominoes, e.g. 2-5, 3-4. I should have said it, sorry.
Nevertheless, there are some missing, three if I had compared them correctly.
##1 \\BvU said:These can only be morphed into one another if you allow a third dimension... a restriction I stuck to and I should have mentioned (i.e. I consider a lefthand glove different from a righthand glove)
I completely missed these two and am really curious about a possible last escapee![]()
fresh_42 said:113. We have a target to shoot arrows at with ##6## rings, labeled ##16,17, 23, 24, 39## and ##40## in the center. Given we always hit what we want, how many different combinations of which rings will add up to exactly ##100## points?
D115
There is a solution.KnotTheorist said:I wrote a short script to check my math and it is not possible to add up any combination of these numbers to get 100. So the answer is 0.
I totally forgot about repeating the same ring.fresh_42 said:There is a solution.
Well, four times 17, not three, but yes, this is the only solution.KnotTheorist said:I totally forgot about repeating the same ring.
I believe the answer is 10. The only way to add up to 100 is 16, 16, 17, 17, 17. So we need to find all possible orders to hit the 16 ring twice and the 17 ring 3 times.
Yes, sorry. In that case it will be 15 combinations.fresh_42 said:Well, four times 17, not three, but yes, this is the only solution.
3x3x3 = 27?fresh_42 said:There is a cube, constituted of 9 smaller ones, like Rubik's.
I avoided that since I feared endless discussions whether there is a cube at the center or not ...mfb said:3x3x3 = 27?
I don't get it. There is only one number per corner, eight corners in total and six numbers at the center of the surfaces, namely the product of the four numbers in the corners, respectively.Let the corners be identified as (x,y,z) where a,b,c= 0 or 1.
Let (0,0,0)=(0,1,0)=(0,0,1)=-1 and use 1 for all other corners. There is one face (x=0) showing -1 from three -1 corners, two faces (y=0 and z=0) showing +1 from two -1 corners, two faces (y=1 and z=1) showing -1 from one -1 corner and one face (x=1) showing +1 from no -1 corner. Sum: -3+5-1+2-2+1 = 0
That's how I understood the puzzle. I made a calculation error, however. -3+5-1+2-2+1 = 2 not 0.fresh_42 said:There is only one number per corner, eight corners in total and six numbers at the center of the surfaces, namely the product of the four numbers in the corners, respectively.
Yes. As several members use coding to solve problems ...mfb said:118:We transform xy to x0y, which means we add 90*x. xy must be a factor of 90*x. Note that 90=2*3*3*5. Trivially x0 becomes x00 after multiplication by 10, I don't list these in the following:
x=1: xy=15 (becomes 105 after multiplying by 7), 18 (becomes 108 after multiplying by 6)
x=2: -
x=3: -
x=4: 45 (becomes 405 after multiplying by 9)
x=5: -
x=6: -
x=7: -
x=8: -
x=9: -
Hmm.. just casework.
fresh_42 said:Is there a winning strategy for one of the players?
Sorry, typo.jbriggs444 said:#119
With only 3004 cards dealt out of 3040, this is not a perfect information game.
Yes.mfb said:Is there a somewhat easy strategy to follow?
If I understand the question correctly then the best I found is covering the E column one by one, saving half of the field. If you let it go into E then it will spread both vertically and towards the larger columns and you can only keep one side from spreading in both directions.fresh_42 said:120. We have ##64## hectares of a square forest, say they are numerated like the chess board. At twelve o'clock a fire starts on ##D1##. Firefighters can secure one hectare from burning every hour. Every next hour, the fire spreads to all horizontally or vertically neighboured hectares (no diagonals). How many hectares can be saved at best?
D120
You can save more than 50% for burning.mfb said:If I understand the question correctly then the best I found is covering the E column one by one, saving half of the field. If you let it go into E then it will spread both vertically and towards the larger columns and you can only keep one side from spreading in both directions.
Am I to understand it does NOT spread to the smaller columns ? Please clarify this spreading (e.g. after D1 it can spread to D2 and to E1 -- not to C1 ?)Fresh said:it will spread both vertically and towards the larger columns