# Why does Talbot\[\] always return 0?

**URL:** <https://community.wolfram.com/t/why-does-talbot-always-return-0/11698>\
**Category:** Questions\
**Tags:** discrete-mathematics\
**Created:** [December 19, 2017, 7:40pm UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698 "2017-12-19T19:40:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ib](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ib/32/29648_2.png) [@ib](https://community.wolfram.com/u/ib)\
**Post date:** [December 19, 2017, 7:40pm UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698/1 "2017-12-19T19:40:24Z")

</div>

Hello,  
I am newbie in Mathematica and Wolfram Language. The function Talbot shall return Re[h/(2_I_Pi)\*ans]] but returns always 0. What is my mistake in parameter passing?

regards - Leo

---

<div class="post-metadata">

**Author:** ![kmartin](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/kmartin/32/38196_2.png) [@kmartin](https://community.wolfram.com/u/kmartin)\
**Post date:** [December 19, 2017, 11:27pm UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698/2 "2017-12-19T23:27:57Z")

</div>

You never really enter the For loop in Talbot. You begin your loop

```auto
For[k = 0, k == N, k++, expr]

```

with N = 64, while k = 0. Because the _test_ `k == N` is False immediately, you never start the loop. Perhaps you meant `k <= N`?

Also, I would recommend avoid using `N` as a variable name in your programs or function definitions, because it is an [already defined function in the Wolfram Language](http://reference.wolfram.com/language/ref/N.html).

---

<div class="post-metadata">

**Author:** ![ib](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ib/32/29648_2.png) [@ib](https://community.wolfram.com/u/ib)\
**Post date:** [December 20, 2017, 12:39am UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698/3 "2017-12-20T00:39:53Z")

</div>

Thank You very much, that were 2 beginner’s mistakes. -  
But I have one more problem. I think I did something wrong with the parameter passing, because Talbot[] doesn’t enter numbers to List but expressions with p. - I am confused. ☹ - As You can see in List below in the notebook.  
thanks for help - regards - Leo

---

<div class="post-metadata">

**Author:** ![kmartin](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/kmartin/32/38196_2.png) [@kmartin](https://community.wolfram.com/u/kmartin)\
**Post date:** [December 20, 2017, 1:39am UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698/4 "2017-12-20T01:39:34Z")

</div>

Well the `p`’s in your `gam` never get defined to be anything other than `p`. I believe `gam` is their original source.

---

<div class="post-metadata">

**Author:** ![ib](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ib/32/29648_2.png) [@ib](https://community.wolfram.com/u/ib)\
**Post date:** [December 20, 2017, 4:06am UTC](https://community.wolfram.com/t/why-does-talbot-always-return-0/11698/5 "2017-12-20T04:06:51Z")

</div>

Thanks - I have set gam, Tp and lap into one formula, and it works now.

regards - Leo
