- 11,153
- 7,655
You cannot define "west" at the south pole.
Same is supposed to hold for "5km towards south" (at southpole)?You cannot define "west" at the south pole.
Yes. That's why we have to circle the south pole.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 doodle104. 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.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
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\,.##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.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)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 \\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
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.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.There is a solution.
Well, four times 17, not three, but yes, this is the only solution.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.