Hearted Youtube comments on Mathologer (@Mathologer) channel.

  1. 4
  2. 4
  3. 4
  4. 4
  5. 4
  6. 4
  7. 4
  8. 4
  9. 4
  10. 4
  11. 4
  12. 4
  13. 4
  14. 4
  15. 4
  16. 4
  17. 4
  18. 4
  19. 4
  20. 4
  21. 30:07 Minimum number of moves for 9 disk and 4 pegs (I think): 41 (^.^). You explained how to divide the disks into 3 superdisks for 8 disks but not for 9. So, just for fun, I tried every possible division in a very inefficient c++ code. I found that you can solve optimally in 41 moves if you divide the disks into 3 superdisks of 2, 3 and 4 disks (from top to down); also dividing them into 4 superdisks of 1, 1, 3 and 4; 1, 2, 2 and 4; AND 1, 2, 3 and 3. I didn't check if these divisions provide different solutions (Challenge for anybody?), but my guess is that, at least, the 3 and 4 superdisk divisions are different optimal solutions. Calculation (hopefully) explained: Assume that you got to solve for 8 disks and 4 pegs, and you divide the 8 disks into 3 superdisks of 1, 3 and 4 disks (from top to down, like Mathologer did). Also note that f(n)=2^n-1 is the optimal number of moves to solve n disks and 3 pegs. Then, (hopefully) it's easy to see that the number of moves, following the Mathologer path, is equal to f(1)+f(3)+f(1)+f(4)+f(1)+f(3)+f(1)=4f(1)+2f(3)+f(4)=2^2 f(1)+2^1 f(3)+2^0 f(4). Note that the arguments of the f's add up to the 8 disks and also note the decreasing powers of 2. (hopefully) it's easy to see that, for n disks, 4 pegs and m superdisks of a1, a2, ..., am disks, such that a1+a2+...+am=n, the resulting number of moves is equal to 2^(m-1)f(a1)+2^(m-2)f(a2)+...+2^0 f(am). For the code, I simply apply this formula to every possible division of the 9 disks into superdisks. I cycle through the possible divisions in a very inefficient and lazy way: I go though all possible lists of between 1 and 9 elements with all possible values between 1 and 9, checking if the accumulation of the elements add up to 9. Seeing the formula, it's easy to see that it's not worth it to check superdisk divisions that are not in decreasing amounts of disks, but whatever. Here's the code for anyone interested: #include <iostream> #include <vector> #include <numeric>//accumulate algorithm using namespace std; int pow(int b,int e){//b to the power of e with e being a non negative integer int ans=1; for(int i=0;i<e;i++)ans*=b; return ans; } int h3(int n){//optimal number of moves with 3 pegs return pow(2,n)-1; } bool operator!=(vector<int>v0,vector<int>v1){//how to compare vectors if(v0.size()!=v1.size())return 1; for(size_t i=0;i<v0.size();i++) if(v0[i]!=v1[i])return 1; return 0; } int main(int argc, char *argv[]) { int N=9;//total amount of disks for(int i=1;i<=N;i++){//i is the number of superdisks used in this attempts vector<int>v(i,1),v0=v;//v holds how many disk in each superdisk, v0 is the initial attempt do{ if(accumulate(v.begin(),v.end(),0)==N){//the total amount of disks has to be N int m=0;//total number of moves in this attempt for(size_t i=0;i<v.size();i++){ m+=pow(2,i)*h3(v[i]); cout<<"2^"<<i<<" f("<<v[i]<<")+"; } cout<<'\b'<<'='<<m<<endl; } for(size_t i=0;i<v.size();i++)//cycle through all possible v's if(v[i]==9)v[i]=1; else{++v[i];break;} } while(v!=v0);//all possible attempts has been searched when v loops back to v0 } return 0; } Enjoy. (^.^)
    4
  22. 4
  23. 4
  24. 4
  25. 4
  26. 4
  27. 4
  28. 4
  29. 4
  30. 4
  31. 4
  32. 4
  33. 4
  34. 4
  35. 4
  36. 4
  37. 4
  38. 4
  39. 4
  40. 4
  41. 4
  42. 4
  43. 4
  44. 4
  45. 4
  46. 4
  47. 4
  48. 4
  49. 4
  50. 4