R programming: Linear Equation

0 votes

Is it possible in R, to list a set of certain possible values for a given equation? For example:

Fora, b, and c with the formula a^3 + b^2 = c.

How can this be tested for all combinations of a and b such that a and b are less than 1000 and c to satisfy the formula and check if the variables are also valid inputs?

Apr 30 in Data Analytics by Tyrion anex
• 8,280 points
16 views

1 answer to this question.

0 votes

Use expand.grid to get all possible combinations and then subset the ones you require:

vals <- expand.grid(x=seq(1000), y=seq(1000))
subset(vals, a^3 + b^2 == 108)
#      a  b
# 8003 3  9
# 9002 2 10
answered Apr 30 by Sophie may
• 9,430 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Steps to evaluate Linear Regression in R

 These are sequential steps which need to ...READ MORE

answered Jul 25, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
88 views
0 votes
1 answer

What are the rules to define a variable name in R programming language?

A variable name in R programming language ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,690 points
70 views
0 votes
1 answer

How can I create log linear models in R language?

By using the loglm () function  READ MORE

answered Oct 10, 2018 in Data Analytics by zombie
• 3,690 points
22 views
+4 votes
2 answers
0 votes
1 answer

R programming: Linear programming problems

The documentation for the lp package provides ...READ MORE

answered Feb 4 in Data Analytics by Tyrion anex
• 8,280 points
54 views
+1 vote
2 answers
0 votes
1 answer

R programming logic

Use gsub to match the substring that we want ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,040 points
21 views
0 votes
1 answer

R Programming: matrices

Try this, It will test if a matrix ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,430 points
25 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,430 points
163 views