1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mamont248 [21]
3 years ago
7

g The reciprocal Fibonacci constant ψ is defined by the infinite sum: ψ=∑n=1 [infinity] 1 Fn Where Fn are the Fibonacci numbers

1,1,2,3,5,8,13,…. Each element in this sequence of numbers is the sum of the previous two. Start by setting the first two elements equal to 1, then Fn=Fn−1+Fn−2 . Write a MATLAB program in a script file that calculates ψ for a given n.

Computers and Technology
1 answer:
timama [110]3 years ago
5 0

Answer:

see explaination

Explanation:

MATLAB script:

% MATLAB script that calculates reciprocal Fibonacci constant Ψ

% Initial Values

a0 = 1;

a1 = 1;

% Looping variable

i = 2;

% Reading n value from user

n = input(' Enter n value: ');

% Initializing sum

sum = (1/a0) + (1/a1);

% Loop till i reaches n value

while i <= n

% Finding term in Fibnocii series

a2 = a0 + a1;

% Accumulating Sum

sum = sum + (1/a2);

% Updating previous terms

a0 = a1;

a1 = a2;

% Incrementing loop variable

i = i + 1;

endwhile

% Printing result

printf("\n Reciprocol Fibnocii Constant: %f \n", sum);

See attachment for sample output

You might be interested in
1. What are the biggest password mistakes that people and companies make? How can you avoid those mistakes?
Ghella [55]

Answer:

1. Keeping a password with user name or password is very easy word.

2. Passwords should be kept strong so that it cannot be haccked. One should use upper case letters along with lower case letters and numeric and special characters to make the password strong.

3. The businesses usually run anti viruses in case of virus attack. In case of haccker attack businesses are temporarily shut down from their routine work and alternate business plan is activated which runs the business activities incognito version.

4. High profile passwords can be leaked as it is on the computer system which can be accessed from around the world.  

Explanation:

The businesses should use DRP system in order to avoid complete shut down of business operations in case of a cyber attack. The passwords should be kept strong enough so that no one can crack the password and all employees should not be given complete access to business operations and planning activities. Employees access should be restricted to their job role.

5 0
3 years ago
If classes C1 and C2 both implement an interface Cint, which has a method whichIsIt, and if C1 c = new C1( ); is performed at on
Assoli18 [71]

Answer:

FALSE

Explanation:

Because C1 and C2 implement the same interface, they both implement whichIsIt. The variable c is known as a polymorphic variable, meaning that it can change from being an C1 to a C2. So, the message c.whichIsIt( ); may invoke C1's whichIsIt or C2's whichIsIt. This can only be known at runtime.

5 0
3 years ago
What does ip mean? internet protocol address internet program internet process (system software) internet prescience?
Mashutka [201]
Ip means internet protocol address
7 0
3 years ago
Write a program that prompts the user to enter integers in the range 1 to 50 and counts the occurrences of each integer. The pro
galben [10]

Answer:

  1. import java.util.Scanner;
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        int num[] = new int[51];
  5.        Scanner input = new Scanner(System.in);
  6.        System.out.print("Number of input: ");
  7.        int limit = input.nextInt();
  8.        for(int i=0; i < limit; i++){
  9.            System.out.print("Input a number (1-50): ");
  10.            int k = input.nextInt();
  11.            num[k]++;
  12.        }
  13.        for(int j=1; j < 51; j++){
  14.            if(num[j] > 0){
  15.                System.out.println("Number of occurrence of " + j + ": " + num[j]);
  16.            }
  17.        }
  18.    }
  19. }

Explanation:

The solution is written in Java.

Firstly, create an integer array with size 51. The array will have 51 items with initial value 0 each (Line 5).

Create a Scanner object and get user entry the number of input (Line 6-7).

Use the input number as the limit to control the number of the for loop iteration to repeatedly get integer input from user (Line 9-13). Whenever user input an integer, use that integer, k, as the index to address the corresponding items in the array and increment it by one (LINE 11-12).

At last, create another for loop to iterate through each item in the array and check if there is any item with value above zero (this means with occurrence at least one). If so, print the item value as number of occurrence (Line 14-17).

8 0
4 years ago
Where in the computer is a variable such as "X" stored?
kow [346]

Answer:

The value of "x" is stored at "main memory".

Explanation:

Simply Central processing unit, input device and output device can not store the data.

7 0
3 years ago
Other questions:
  • Two columns of a relational table can have the same names. <br> a. True <br> b. False
    15·1 answer
  • The creation of​ __________ with digital media allows for large quantities of numerical or textual data to be searched online by
    10·2 answers
  • Ano kaya ang nararamdaman mo at mangyari sayo kung tatlong araw ka nang hindi kumakain​
    6·1 answer
  • The Color Picker tool enables you to work with color selections. Which of the following color models are used by the Color Picke
    11·1 answer
  • Can someone pls help me my notifications aren’t working, I need help ASAP ty!
    5·1 answer
  • What is true about content based filtering
    8·1 answer
  • Pls answer i need to turn it in today!!
    15·1 answer
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • Select the correct answer.
    12·2 answers
  • Consider a file/directory with the following info:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!