Is the formula given the same as the code?

Hey guys. I’m currently having a disagreement with a lecturer over this assignment question. I believe that the code should be changed to t=0:6 to match the formula they have given. We were given a morality table so do not worry about dx or lx as those are set variables. Any clarification on this would be greatly appreciated. Thank you, O.H

 採用された回答

Rik
Rik 2021 年 10 月 22 日

0 投票

Since the exponents range from -1 to -7, that means you will need 7 different values for t. One of the ways to achieve that is indeed having t=0:6.
Neither is infinite (as the summation indicates), but this might be a reasonable approximation for your application.

3 件のコメント

Oscar Holyoake
Oscar Holyoake 2021 年 10 月 22 日
Thank you so much! That is exactly what I wanted to hear. I knew the lecturers code was wrong!
It’s not infinite as dx can only go up to d99 therefore should stop at the 7th variable.
Thanks again!
Rik
Rik 2021 年 10 月 22 日
Maybe the infinity symbol should be replaced by that upper bound:
Oscar Holyoake
Oscar Holyoake 2021 年 10 月 22 日
Actually, I guess technically it is bounded to infinity, but if x>100 then dx and lx = 0. Either way you would get the same answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

質問済み:

2021 年 10 月 22 日

コメント済み:

2021 年 10 月 22 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by