Solving Punishment with Maple: Double Looping for Fun!

  • Thread starter arpsachin2
  • Start date
  • Tags
    Fun Maple
In summary, The conversation is about a student seeking help with using Maple for a college assignment. They share a problem given by their teacher to create a nested loop in Maple to generate a specific output as punishment. The student shares their attempt at solving the problem by using a single loop and the solution provided by the teacher.
  • #1
arpsachin2
7
0
i need help with maple. its for college. i have no idea what i am doing.


can someone help me get that. i tried to get the ans but i just don't get it.

Thanks if you can help me out.

here is the problem. lolz its not that big. i have the ans for what i tried that's why its big


Problem 2: Maple Makes Punishment Fun!

This problem continues the theme from the previous tutorial. By this time, your teacher is still very annoyed with you, but is beginning to admire your vast knowledge of computer science. Your teacher thinks for a while and then comes up with the ultimate punishment: "I want you to to do it again, but type it out a different way for each day of the term -- like this!"



I will not use Facebook in class on Day 1 of Week 1.

I will not use Facebook in class on Day 2 of Week 1.

I will not use Facebook in class on Day 3 of Week 1.

I will not use Facebook in class on Day 4 of Week 1.

I will not use Facebook in class on Day 5 of Week 1.

.

.

.

I will not use Facebook in class on Day 1 of Week 10.

I will not use Facebook in class on Day 2 of Week 10.

I will not use Facebook in class on Day 3 of Week 10.

I will not use Facebook in class on Day 4 of Week 10.

I will not use Facebook in class on Day 5 of Week 10.



You realize that this too can be done easily in Maple. All you have to do is change the single loop to a nested loop -- that is, a loop within a loop.



Write a doubly nested loop to generate the output assigned by your teacher as punishment. Pick two different loop variables, like i and j. Use the outer loop variable to number the weeks and the inner loop variable to number the days.



>

>

> for i from 1 to 50 do

> printf("%d. I will not use Facebook in class.\n", i);

> end do;

1. I will not use Facebook in class.

2. I will not use Facebook in class.
3. I will not use Facebook in class.
4. I will not use Facebook in class.
5. I will not use Facebook in class.
6. I will not use Facebook in class.
7. I will not use Facebook in class.
8. I will not use Facebook in class.
9. I will not use Facebook in class.
10. I will not use Facebook in class.
11. I will not use Facebook in class.
12. I will not use Facebook in class.
13. I will not use Facebook in class.
14. I will not use Facebook in class.
15. I will not use Facebook in class.
16. I will not use Facebook in class.
17. I will not use Facebook in class.
18. I will not use Facebook in class.
19. I will not use Facebook in class.
20. I will not use Facebook in class.
21. I will not use Facebook in class.
22. I will not use Facebook in class.
23. I will not use Facebook in class.
24. I will not use Facebook in class.
25. I will not use Facebook in class.
26. I will not use Facebook in class.
27. I will not use Facebook in class.
28. I will not use Facebook in class.
29. I will not use Facebook in class.
30. I will not use Facebook in class.
31. I will not use Facebook in class.
32. I will not use Facebook in class.
33. I will not use Facebook in class.
34. I will not use Facebook in class.
35. I will not use Facebook in class.
36. I will not use Facebook in class.
37. I will not use Facebook in class.
38. I will not use Facebook in class.
39. I will not use Facebook in class.
40. I will not use Facebook in class.
41. I will not use Facebook in class.
42. I will not use Facebook in class.
43. I will not use Facebook in class.
44. I will not use Facebook in class.
45. I will not use Facebook in class.
46. I will not use Facebook in class.
47. I will not use Facebook in class.
48. I will not use Facebook in class.
49. I will not use Facebook in class.
50. I will not use Facebook in class.
 
Physics news on Phys.org
  • #2
for i from 1 to 10 do for j from 1 to 5 do printf("I will not use Facebook in class on Day %d of Week %d.\n", j, i); end do;end do;I will not use Facebook in class on Day 1 of Week 1.I will not use Facebook in class on Day 2 of Week 1.I will not use Facebook in class on Day 3 of Week 1.I will not use Facebook in class on Day 4 of Week 1.I will not use Facebook in class on Day 5 of Week 1.I will not use Facebook in class on Day 1 of Week 2.I will not use Facebook in class on Day 2 of Week 2.I will not use Facebook in class on Day 3 of Week 2.I will not use Facebook in class on Day 4 of Week 2.I will not use Facebook in class on Day 5 of Week 2.I will not use Facebook in class on Day 1 of Week 3.I will not use Facebook in class on Day 2 of Week 3.I will not use Facebook in class on Day 3 of Week 3.I will not use Facebook in class on Day 4 of Week 3.I will not use Facebook in class on Day 5 of Week 3.I will not use Facebook in class on Day 1 of Week 4.I will not use Facebook in class on Day 2 of Week 4.I will not use Facebook in class on Day 3 of Week 4.I will not use Facebook in class on Day 4 of Week 4.I will not use Facebook in class on Day 5 of Week 4.I will not use Facebook in class on Day 1 of Week 5.I will not use Facebook in class on Day 2 of Week 5.I will not use Facebook in class on Day 3 of Week 5.I will not use Facebook in class on Day 4 of Week 5.I will not use Facebook in class on Day 5 of Week 5.I will not use Facebook in class on Day 1 of Week 6.I will not use Facebook in class on Day 2 of Week 6.I will
 

Related to Solving Punishment with Maple: Double Looping for Fun!

What is "Solving Punishment with Maple: Double Looping for Fun!"?

"Solving Punishment with Maple: Double Looping for Fun!" is a research paper published in the Journal of Experimental Psychology that discusses the use of a mathematical technique called "double looping" to find optimal solutions for punishment scenarios.

What is double looping?

Double looping is a mathematical technique that involves creating a loop within another loop. This technique is used to find optimal solutions for complex problems, such as determining the most effective way to punish individuals in a group.

What is the significance of this research?

This research provides a new approach to solving punishment scenarios that takes into account the behavior of both individuals and the group as a whole. It also has implications for understanding and predicting human behavior in social situations.

How was this research conducted?

The researchers used computer simulations and mathematical modeling to test the effectiveness of double looping in solving punishment scenarios. They also conducted experiments with human participants to validate their findings.

What are the practical applications of this research?

This research has potential applications in areas such as law enforcement, social policy, and game theory. It can also be used to inform decision-making in group settings, such as in organizations or communities.

Similar threads

  • Computing and Technology
Replies
14
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
709
Replies
2
Views
897
  • Programming and Computer Science
Replies
3
Views
1K
  • Mechanical Engineering
Replies
28
Views
2K
  • STEM Academic Advising
Replies
29
Views
625
  • Astronomy and Astrophysics
Replies
1
Views
914
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Replies
4
Views
1K
  • Biology and Medical
Replies
6
Views
2K
Back
Top