Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
6eb41707
Commit
6eb41707
authored
7 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Adding graphic explanation
parent
9f661f0b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Doc/Sd1/Ref/Statements/phythagorean.svg
+386
-0
386 additions, 0 deletions
Doc/Sd1/Ref/Statements/phythagorean.svg
Doc/Sd1/statements.xml
+60
-23
60 additions, 23 deletions
Doc/Sd1/statements.xml
with
446 additions
and
23 deletions
Doc/Sd1/Ref/Statements/phythagorean.svg
0 → 100644
+
386
−
0
View file @
6eb41707
This diff is collapsed.
Click to expand it.
Doc/Sd1/statements.xml
+
60
−
23
View file @
6eb41707
...
...
@@ -2691,9 +2691,18 @@ import java.util.Random;
<qandadiv>
<qandaentry>
<question>
<para>
Read the
<link
xlink:href=
"https://en.wikipedia.org/wiki/Pythagorean_triple"
>
definition
of Pythagorean triples
</link>
.
</para>
<para><link
xlink:href=
"https://en.wikipedia.org/wiki/Pythagorean_triple"
>
Pythagorean
triples
</link>
are integer combinations of three values being
related by the
<link
xlink:href=
"https://en.wikipedia.org/wiki/Pythagorean_theorem"
>
Pythagorean
theorem
</link>
:
</para>
<mediaobject>
<imageobject>
<imagedata
fileref=
"Ref/Statements/phythagorean.svg"
/>
</imageobject>
</mediaobject>
<para>
Find all
<link
xlink:href=
"https://en.wikipedia.org/wiki/Pythagorean_triple"
>
Pythagorean
...
...
@@ -2741,8 +2750,7 @@ import java.util.Random;
</inlineequation>
.
</para>
<tip>
<para>
Think of writing a program which creates all possible
triples
<inlineequation>
<para>
Think of creating all possible triples
<inlineequation>
<m:math
display=
"inline"
>
<m:mrow>
<m:mo>
(
</m:mo>
...
...
@@ -2807,7 +2815,8 @@ import java.util.Random;
</tr>
</informaltable>
<para>
Why does the value 998 appear here?
</para>
<para>
Why does a value of 838 rather then 840 appears
here?
</para>
<para>
This list mostly contains values like
<inlineequation>
<m:math
display=
"inline"
>
...
...
@@ -2819,60 +2828,68 @@ import java.util.Random;
<m:mo>
,
</m:mo>
<m:mn>
4
</m:mn>
<m:mn>
3
</m:mn>
<m:mo>
,
</m:mo>
<m:mn>
3
</m:mn>
<m:mn>
4
</m:mn>
</m:mrow>
<m:mo>
)
</m:mo>
</m:mrow>
</m:math>
</inlineequation>
failing
to obey
our restriction
</inlineequation>
failing
both
our restriction
s
<inlineequation>
<m:math
display=
"inline"
>
<m:mrow>
<m:mrow>
<m:mn>
1
</m:mn>
<m:mo>
+
</m:mo>
<m:msup>
<m:mn>
1
</m:mn>
<m:mn>
4
</m:mn>
<m:mn>
2
</m:mn>
</m:msup>
<m:mo>
+
</m:mo>
<m:mn>
3
</m:mn>
<m:msup>
<m:mn>
3
</m:mn>
<m:mn>
2
</m:mn>
</m:msup>
</m:mrow>
<m:mo>
≠
</m:mo>
<m:mi>
840
</m:mi>
<m:msup>
<m:mn>
4
</m:mn>
<m:mn>
2
</m:mn>
</m:msup>
</m:mrow>
</m:math>
</inlineequation>
. These triples have thus to be filtered
retaining only the desired combinations simultaneously obeying
both
<inlineequation>
</inlineequation>
and
<inlineequation>
<m:math
display=
"inline"
>
<m:mrow>
<m:mrow>
<m:m
i>
a
</m:m
i
>
<m:m
n>
1
</m:m
n
>
<m:mo>
+
</m:mo>
<m:m
i>
b
</m:m
i
>
<m:m
n>
3
</m:m
n
>
<m:mo>
+
</m:mo>
<m:m
i>
c
</m:m
i
>
<m:m
n>
4
</m:m
n
>
</m:mrow>
<m:mo>
=
</m:mo>
<m:mo>
≠
</m:mo>
<m:mi>
840
</m:mi>
</m:mrow>
</m:math>
</inlineequation>
and
<inlineequation>
</inlineequation>
. These triples have thus to be filtered
retaining only the desired combinations simultaneously obeying
both
<inlineequation>
<m:math
display=
"inline"
>
<m:mrow>
<m:mrow>
...
...
@@ -2900,6 +2917,26 @@ import java.util.Random;
</m:msup>
</m:mrow>
</m:math>
</inlineequation>
and
<inlineequation>
<m:math
display=
"inline"
>
<m:mrow>
<m:mrow>
<m:mi>
a
</m:mi>
<m:mo>
+
</m:mo>
<m:mi>
b
</m:mi>
<m:mo>
+
</m:mo>
<m:mi>
c
</m:mi>
</m:mrow>
<m:mo>
=
</m:mo>
<m:mi>
840
</m:mi>
</m:mrow>
</m:math>
</inlineequation>
. This might be accomplished by
implementing three nested loops:
</para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment