Kimossab

[Maple] Frequencia 2012

Jun 10th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. equivale := proc (p, q) options operator, arrow; (not p or q) and (p or not q) end proc;
  2. (p, q) -> (not p or q) and (p or not q)
  3. for p in [true, false] do for q in [true, false] do print(p, q, equivale(p, q)) end do end do;
  4. true, true, true
  5. true, false, false
  6. false, true, false
  7. false, false, true
  8. X := {seq(x, x = 1 .. 7)};
  9. {1, 2, 3, 4, 5, 6, 7}
  10. for x in X do for y in X do if irem(x^3*y+x*y^3, 5) <> 2 then print(x, y) end if end do end do;
  11. 1, 2
  12. 1, 3
  13. 1, 4
  14. 1, 5
  15. 1, 7
  16. 2, 1
  17. 2, 3
  18. 2, 4
  19. 2, 5
  20. 2, 6
  21. 3, 1
  22. 3, 2
  23. 3, 4
  24. 3, 5
  25. 3, 6
  26. 3, 7
  27. 4, 1
  28. 4, 2
  29. 4, 3
  30. 4, 5
  31. 4, 6
  32. 4, 7
  33. 5, 1
  34. 5, 2
  35. 5, 3
  36. 5, 4
  37. 5, 5
  38. 5, 6
  39. 5, 7
  40. 6, 2
  41. 6, 3
  42. 6, 4
  43. 6, 5
  44. 6, 7
  45. 7, 1
  46. 7, 3
  47. 7, 4
  48. 7, 5
  49. 7, 6
  50. for x in X do for y in X do if irem(x^3*y+x*y^3, 5) = 2 then print(x, y); break; break end if end do end do;
  51. 1, 1
  52. 2, 2
  53. 3, 3
  54. 4, 4
  55. 6, 1
  56. 7, 2
  57.  
  58. Y := {seq(y, y = 0 .. 10)};
  59. {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
  60. for x in Y do for y in Y do if (x+1)^2+y^2 = 100 then print([x, y]) end if end do end do;
  61. [5, 8]
  62. [7, 6]
  63. [9, 0]
  64. h := proc (n) options operator, arrow; piecewise(n < 5, 1, 5 <= n, sum(j/(j+1), j = 1 .. n)) end proc;
  65. / n \
  66. | ----- |
  67. | \ |
  68. | ) j |
  69. n -> piecewise|n < 5, 1, 5 <= n, / -----|
  70. | ----- j + 1|
  71. \ j = 1 /
  72. evalf(h(8));
  73. 6.171031746
  74. f := proc (n) options operator, arrow; piecewise(n = 1, 1, 2 <= n, (1/2)*n*f(n-1)) end proc;
  75. / 1 \
  76. n -> piecewise|n = 1, 1, 2 <= n, - n f(n - 1)|
  77. \ 2 /
  78. f(20);
  79. 9280784638125
  80. -------------
  81. 2
  82. evalf(%);
  83. 12
  84. 4.640392319 10
  85. for n to 10 do if irem(f(n), 2) = 0 then print(n) end if end do;
  86. Error, invalid input: irem received 3/2, which is not valid for its 1st argument, m
Advertisement
Add Comment
Please, Sign In to add comment